FragmentMaster icon indicating copy to clipboard operation
FragmentMaster copied to clipboard

Clear backstack

Open parassftpl opened this issue 8 years ago • 1 comments

I have a button in my Activity. On click of button, I want to clear whole backstack and keep my home fragment.

How do I do that?

parassftpl avatar Oct 14 '16 09:10 parassftpl

List<IMasterFragment> fragments =  getFragmentMaster().getFragments();
for(int i = fragments.size() - 1; i > 0; i--) {
    fragments.get(i).finish();
}

fengdai avatar Oct 17 '16 02:10 fengdai