Skip to content

Instantly share code, notes, and snippets.

@sockeqwe
Forked from ikew0ng/ClearBackStack.java
Created January 7, 2014 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sockeqwe/8307292 to your computer and use it in GitHub Desktop.
Save sockeqwe/8307292 to your computer and use it in GitHub Desktop.
/**
* Remove all entries from the backStack of this fragmentManager.
*
* @param fragmentManager the fragmentManager to clear.
*/
private void clearBackStack(FragmentManager fragmentManager) {
if (fragmentManager.getBackStackEntryCount() > 0) {
FragmentManager.BackStackEntry entry = fragmentManager.getBackStackEntryAt(0);
mFragmentManager.popBackStack(entry.getId(), FragmentManager.POP_BACK_STACK_INCLUSIVE);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment