2

I have the following scenario:

A(Bottom) -> B -> C -> D(Top) -back-> A
A(Bottom) -> B -> C -back-> B -back-> A

Once I'm on the top (D fragment) I want to pop B and C fragment. On this way when I press back from D I can to A.

I want to avoid the transitions on B and C when I back from D. A(Bottom) -> B -> C -> D(Top) -back-> C -back-> B -back-> A

It is even posible?

Ricardo
  • 7,921
  • 14
  • 64
  • 111

1 Answers1

0

If I understand your situation correctly, then when creating fragment D right before that you can try getFragmentManager().popBackStack() which will look at your fragment stack and simply pop the last fragment. For this to work, you need to ensure that B and C are on the backstack so when creating those fragments you will need to call addToBackStack(null). Now, when creating fragment D you can just popBackStack() twice and that will bring you back to A. I hope I am understanding your situation correctly.

Sahith Reddy
  • 263
  • 3
  • 10