how to avoid creating the loop with the fragment backstack

923 views Asked by At

I am trying to navigate between fragments like below:

Fragment A --> Fragment B --> Fragment C --> Fragment D

and the user can again navigate from Fragment D --> Fragment A like below:

Fragment D --> Fragment A --> Fragment B --> Fragment C --> Fragment D

in this case a loop is created on the back press key.How to manage this type of situation to avoid the loop of fragment on backpress.

1

There are 1 answers

0
Stepango On

Navigation loop not a bad thing. Do not try to avoid it.

There is navigation pattern that could help you with this problem http://developer.android.com/design/patterns/navigation.html