I have a Fragment
stack, which fragments are add
ed to (not replace
d). The problem is, because of memory issues, I don't want to have more than a specific amount of fragments in the stack. Suppose I have added fragments A, B, C, D to the stack. Now that I want to add
the Fragment
E, I want the A
to be removed, using this piece of code:
fragmentManager.beginTransaction().remove(fragmentA).commit()
I get fragmentA
using findFragmentByTag()
and I am sure fragmentA
exists and is in the stack. But this has no effect, and doesn't remove fragmentA
.
What's wrong you think?
Is it possible to remove a fragment from bottom of the stack?