public void remove() { FragmentElement lastFragment = popInternal(); if (lastFragment != null) { FragmentTransaction transaction = fm.beginTransaction(); transaction.remove(lastFragment.getFragment()); transaction.commitAllowingStateLoss(); } }
public FragmentElement popAndReplace(@IdRes int place) { hide(); FragmentElement pop = pop(); if (pop != null) { replace(place, pop.getFragment(), pop.getName(), pop.isAddtoBackStack()); } return pop; }
public FragmentElement popAndShow() { hide(); FragmentElement pop = pop(); if (pop != null) { show(pop.getFragment(), pop.getName(), pop.isAddtoBackStack()); } return pop; }
public void onResume() { FragmentElement fragmentElement = popInternal(); if (fragmentElement != null) { show( fragmentElement.getFragment(), fragmentElement.getName(), fragmentElement.isAddtoBackStack()); } }
public void clear() { FragmentElement fragmentElement = popInternal(); while (fragmentElement != null) { hide(fragmentElement.getFragment()); fragmentElement = popInternal(); } int backStackSize = fm.getBackStackEntryCount(); for (int i = 0; i < backStackSize; i++) { fm.popBackStack(); } }
public void hide() { FragmentElement lastFragment = lastShownFragment(); if (lastFragment != null) { hide(lastFragment.getFragment()); } }