Start an Activity from an item in the bottom navigation (menu bar)

Asked

Viewed 79 times

0

I have the Activity main and a bottom bar navigation with 4 items. When I start the application, it starts, shows the Activity of the first item. I wanted to make it "start" from item 3. Is it possible to do this? How?

1 answer

3


Statement:

AHBottomNavigationViewPager viewPagerBottom;
AHBottomNavigation bottomNavigation;

To start on the chosen Fragment do this on Oncreate or where it has already identified the items:

viewPagerBottom.setCurrentItem(posição);

To follow the selection of the corresponding button you do:

bottomNavigation.setCurrentItem(posição);
  • That’s right, that’s right, thank you !

Browser other questions tagged

You are not signed in. Login or sign up in order to post.