What is the best way to clear fragment back stack programmatic?
I've implemented screen navigation using only one activity and set of fragments. I would like to have method that brings user to the login screen(when logout timeout expires) and clears all fragment history, what is the best way to do that? I found few answers here yet I've dont know which is the best one...Thanks in advance!
for the moment I'm using this one
public void clearBackStack() {
FragmentManager fragmentManager = holder.getSupportFragmentManager();
while (fragmentManager.getBackStackEntryCount() != 0) {
fragmentManager.popBackStack(null, 0);
}
}
Yet sometimes I'm getting outOfMemoryException