I have 4 fragments in a drawer, lets call them fragment A, B, C, D. I use navigation architecture to bind my fragments with the drawer.
Fragment A is my entry point and from there I can navigate anywhere on the drawer.
Suppose I take the path A > B > C > B > C
If I press back from C, it goes to B then to C again and then to B and finally to A, but I don't want that.
When I press the back button from C, I want it to just go back to B then A without recreating fragments that are already in the back stack. Can someone please help on how to achieve this ?