1
votes

I have 5 fragments in my app. I use backstack. When I open fragment, he added to backstack.

[Fragment1]->[Fragment2]->[Fragment3]->[Fragment4]->[Fragment5]

And when I click back-button I need to open 2 latest fragmets cyclically.

[Fragment4]->[Fragment5]->[Fragment4]->[Fragment5]->[Fragment4]->[Fragment5]

Is it possible?

1
I am not sure of what you are asking here. But it looks like you just need a custom implementation of onBackPressed method of your root activity. Just check, what fragment is on the top of stack, and implement to load the fragment off the stack logically. - sushant kunal

1 Answers

0
votes

This issue resolved. I use backstack without repeating fragment. It's better!