I need to create a specific behavior at some point in my app. I use a navigation drawer and I replace fragments in a frame layout.
Let's say I have some fragments in the backstack: A -> B -> C.
A is one of the root fragments in my app, if the back button is pressed on A, the app quits.
When I am on C (with A and B in the backstack) I want to go to E with D in the backstack. Meaning if I press the back button on E, I want to go to D (D being another root fragment in my app, if I press the back button on D the app quits).
For now I clear the back stack, then I replace the current fragment with D and then with E.
The problem with this is that I see the fragment A for a small amount of time during the transition from C to E. (And it's ugly right?)