I use this code to clear my back to my main view:
while(mFragmentManager.getBackStackEntryCount() > 1) { mFragmentManager.popBackStack(null, 0); }
I am sure that this code worked before, but now the backstack count does not change, and the Fragment is not deleted, which causes an exception from memory, because the while loop continues to work.
Does anyone know if something is wrong with him, or if there is an error in the latest version of the SDK tools. I do not know what causes the problem.
source share