public class HomeActivity extends BaseBottomNavActivity { //thinned down sample implementation of the BaseBottomNavActivity above private ActivityHomeBinding binding; public static void start(Activity activity) { Intent intent = new Intent(activity.getApplicationContext(), HomeActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); activity.startActivity(intent); } public static Intent getStartIntent(Context context) { // if required in a service etc Intent intent = new Intent(context, HomeActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); return intent; } @Override protected void initOnCreate(Bundle savedInstanceState) { binding = DataBindingUtil.setContentView(this, R.layout.activity_home); } @Override protected void onNavBarReselect() { removeProfileFragmentIfAdded(); // sample method call } private boolean removeProfileFragmentIfAdded() { boolean wasAdded = getSupportFragmentManager().popBackStackImmediate(); if (wasAdded) { mIsDataFetched.setValue(true); setupActionBar(binding.layoutToolbar, getString(R.string.title_home), false); binding.contentSwipeRl.setEnabled(true); showToolbarIconFor(null); removeViewProfileFragment(); updateAddStoryFabVisibility(false); } return wasAdded; } @Override protected int getCurrentBottomNavPosition() { return CustomBottomNavigationBar.POSITION_HOME_TAB; } @Override protected CustomBottomNavigationBar getBottomNavigationBar() { return binding.bottomNavBar; } @Override public void onBackPressed() { boolean wasAdded = removeProfileFragmentIfAdded(); if (!wasAdded) { super.onBackPressed(); } } }