Skip to content

Instantly share code, notes, and snippets.

@ikew0ng
Created January 7, 2014 09:41
Show Gist options
  • Save ikew0ng/8297033 to your computer and use it in GitHub Desktop.
Save ikew0ng/8297033 to your computer and use it in GitHub Desktop.
Clear fragment backStack
/**
* 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);
}
}
@cbess
Copy link

cbess commented Dec 12, 2014

Fixed an issue I was having.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment