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

0

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

    
asked by anonymous 18.02.2018 / 05:03

1 answer

3

Statement:

AHBottomNavigationViewPager viewPagerBottom;
AHBottomNavigation bottomNavigation;

To start in the chosen fragment do this in 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);
    
18.02.2018 / 05:58