second tap on bottomNavView tab - NavigationAdvancedSample
ive implemented the recommended workaround provided here for maintaining state on each tab when using the navigation component. https://github.com/googlesamples/android-architecture-components/tree/master/NavigationAdvancedSample
that works nicely. however - if a user taps TWICE on the same tab - then all of that back stack is removed completely and the tab's back stack resets itself!
it might be expected behaviour (resetting a tab's back stack on 2nd tap) - however, how can we prevent this 'second tap' behaviour as it totally negates the provided workaround ?
I am facing the same issue, anyone, please update on this.
@SogoGolf
navController.addOnDestinationChangedListener(new NavController.OnDestinationChangedListener() {
@Override
public void onDestinationChanged(@NonNull NavController controller, @NonNull NavDestination destination, @Nullable Bundle arguments) {
**findViewById(bottomNavigationView.getSelectedItemId()).setEnabled(false);**
});
Disabled selected tab works for me
This was fixed in #578