Skip to content

Disable reselecting in BottomNavigationView

How can I disable reloading fragment when clicking again on the current tab in BottomNavigationView?

In other words how to disable re-selection in BottomNavigationView?

PS: I’m using NavigationUI to setup BottomNavigationView


It was surprisingly simple!

    NavigationUI.setupWithNavController(bottomNavigationView, hostNavController);
    bottomNavigationView.setOnNavigationItemReselectedListener(new BottomNavigationView.OnNavigationItemReselectedListener() {
        public void onNavigationItemReselected(@NonNull MenuItem item) {
            // Nothing here to disable reselect