Home > Mobile >  how to set default selection on bottom Navigation bar android studio
how to set default selection on bottom Navigation bar android studio

Time:02-26

I want to make this middle item as default selection when I open My application

CodePudding user response:

write the code in onCreate method. remember dont write in mBottomNavigationView.setOnNavigationItemSelectedListener{}

    BottomNavigationView mBottomNavigationView=(BottomNavigationView)findViewById(R.id.bottom_nav);
mBottomNavigationView.getMenu().findItem(R.id.item_id).setChecked(true);
  • Related