I have several fragments that keep replacing each other (with the transactions added to the backstack). Depending on user actions at some point I need to clear all (or some) of the previous fragments and show only 1 new fragment.
To do this I currently do a popBackStack()
to clear them first and then do a replace()
, this works as expected. However sometimes there is a flash of the previous fragment before we see the new fragment. I think this is because I am popping the backstack first before showing the new fragment.
So I'm just wondering if there is a simple way to first display the new fragment and then clear the backstack of the previous transactions?