'How to remove the toast like popup in BottomNavigationView when long press the item?

How to remove the toast like popup in material bottom navigation view BottomNavigationView occurs when we long press the single item .The demo image attached belowenter image description here



Solution 1:[1]

That is tooltip, It can be disabled by calling TooltipCompat.setTooltipText(view, null) on each menu item.

bottomNavigationView
    .menu.forEach {
            TooltipCompat.setTooltipText(bottomNavigationView.findViewById<View>(it.itemId), null)
        }

There's a possible chance that the above code won't work, when the bottomNavigationView sets the tooltip text after you set it as null. You can override the longClickListener on the menu item itself, so it won't show a tooltip text.

bottomNavigationView
    .menu.forEach {
        bottomNavigationView.findViewById<View>(it.itemId).setOnLongClickListener {
            // add any code which you want to execute on long click
            true
            }
    }

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1