Foot trim limit

How to make the maximum stack size in 5 fragments. Adding 6 fragments, 1 fragment should be deleted, but calmly, without displaying the screen.

[Fragment1] β†’ [FRAGMENT2] β†’ [Fragment3] β†’ [Fragment4] β†’ [Fragment5]

6 fragments added

<y> [Fragment1] [FRAGMENT2] β†’ [Fragment3] β†’ [Fragment4] β†’ [Fragment5] β†’ [Fragment6]

when the user returns, he will be on 5 screens.

The main problem is how to remove FragmentManager.BackStackEntry from the stop fragment manager in silent mode without clicking on the screen.

Is it possible?

+7
android fragments
source share

No one has answered this question yet.

See related questions:

937
findViewById in fragment
455
Just for everyone, how to properly save the state of the fragment instance on the stack?
23
Replace fragment with another fragment inside ViewPager
5
Android: issues with dialog box fragments and backstack
2
Remove snippet from backstack problem
one
How to remove a fragment from the back stack?
one
Android snippets move on the stack
one
Loop fragment
0
Viewpager: fragment replacement (exchange)
0
DrawerLayout Clicking on top-level fragments

All Articles