@Override public void onBackPressed() { if (mNavController.getCurrentStack().size() > 1) { mNavController.pop(); } else { super.onBackPressed(); } }
@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); // Necessary to restore the BottomBar's state, otherwise we would // lose the current tab on orientation change. mBottomBar.onSaveInstanceState(outState); mNavController.onSaveInstanceState(outState); }
@Override public void pushFragment(Fragment fragment) { mNavController.push(fragment); }