What is the best way to clear a piece of software back?
I implemented on-screen navigation using only one action and a set of fragments. I would like to have a method that displays the user on the login screen (when the logout time expires) and clears the entire fragment history, what is the best way to do this? I found some answers here, but I do not know which is the best ... Thanks in advance!
I am currently using this
public void clearBackStack() {
FragmentManager fragmentManager = holder.getSupportFragmentManager();
while (fragmentManager.getBackStackEntryCount() != 0) {
fragmentManager.popBackStack(null, 0);
}
}
However, sometimes I get outOfMemoryException
source
share