Issue
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
Solution
It was surprisingly simple!
NavigationUI.setupWithNavController(bottomNavigationView, hostNavController);
bottomNavigationView.setOnNavigationItemReselectedListener(new BottomNavigationView.OnNavigationItemReselectedListener() {
@Override
public void onNavigationItemReselected(@NonNull MenuItem item) {
// Nothing here to disable reselect
}
});
Answered By - Mohammad Hossein Kalantarian
Answer Checked By - David Marino (JavaFixing Volunteer)