I got a problem. I have master detail view and i replace fragments by fragment manager. It works but after changing some of them i got a memory error. And fragment doesn't have any pictures inside(every replacing fragment have a quite big image). The question is how to delete those fragment from stack that I'm not using anymore? Preventing memory errors.
Best How To :
how to delete those fragment from stack that I'm not using anymore?
You add to the back state from the
FragmentTransaction and remove from the backstack using
FragmentManager pop methods:
FragmentManager manager = getActivity().getSupportFragmentManager();
FragmentTransaction trans = manager.beginTransaction();