I have bottomNavigation in my android app as shown below in picture. It works fine if I just click on home
, cart
and other bottomNavigation Items.
As you can see in picture that user can navigate to all categories
in home
. If I navigate to AllCategoriesFragment
then in home
item will be selected in bottomNavigation which is correct behavior. But if I go to cart
and then click again on home
then it shows AllCategoriesFragment
which is also correct behavior but in BottomNavigation it doesnt highlight the home
items, instead it keep cart
item highlighted.
How I can get rid of this issue? Or how I can highlight the bottomNavigation selected item programmatically?