Answers for "bottom navigation item switch item android"

1

android up navigation

@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
  int itemId = item.getItemId();
  if (itemId == android.R.id.home) {
    // force up navigation to have the same behavior as temporal navigation
    onBackPressed();
    return true;
  } else {
    return super.onOptionsItemSelected(item);
  }
}
Posted by: Guest on March-08-2021
1

android bottomnavigationview set current item

BottomNavigationView bottomNavigationView;
bottomNavigationView = (BottomNavigationView) findViewById(R.id.bottomNavigationView);
bottomNavigationView.setOnNavigationItemSelectedListener(myNavigationItemListener);
bottomNavigationView.setSelectedItemId(R.id.my_menu_item_id);
Posted by: Guest on August-13-2020

Code answers related to "bottom navigation item switch item android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language