'Navigate to specific fragment from fragment
I am trying to navigate back to specific fragment from current fragment, suppose the flow is
A -> B -> C -> D
now I am currently at fragment D, now what I want is
fragment D -> A
found couple of solutions but it is disturbing my navigating flow like disabling my back button and etc.
Solution 1:[1]
That's not how fragments work, when you add fragment to fragment manager, objects of fragments get stored in fragmentmanager's backstack. With multiple fragments they do not get rendered at the same time so that it would work with just show and hide. Therefore show and hide do not work. Only a single fragment gets rendered in fragment container which is on the top of the fragment backstack.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Khalid |
