Reputation: 9047
Is there a simple way to manually switch between items of a BottomNavigationView?
I couldn't find any relevant method in the source code.
Upvotes: 1
Views: 521
Reputation: 2221
A safer alternative to Hamed's solution would be the following:
bottomNav.setSelectedItemId(bottomNav.getMenu().getItem(ITEM_INDEX).getItemId());
Upvotes: 0
Reputation: 9047
Ok, I found a temporary workaround for this until an official update addresses this issue.
((BottomNavigationMenuView) bottomNav.getChildAt(0)).getChildAt(ITEM_INDEX).callOnClick();
Upvotes: 2