I add a bunch of FragmentTransactions to the back stack in one Tab, and I want to clear them ALL from the back stack when the user selects a different Tab. I can’t find a method to clear stuff off the back stack, only methods to pop them off, and these don’t even return the Fragment to you so you can close them. Any ideas?
Share
If you add many Fragments to the backstack and want to remove them all you can do this:
popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE)