Delete one specific fragment from the Android backstack

前端 未结 4 1687
离开以前
离开以前 2020-12-30 00:46

For a android tablet application I use 2 fragments. One on the left side on the screen and one on the right side. When you click on a button at the right fragment, another f

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-30 01:29

    I just answered a similar question, so here's a link to that answer.

    The implementation allows you to remove a Fragment from anywhere in the backstack and this is achieved by using refrection to modify the internal variables that store the backstack information in FragmentManagerImpl and BackStackRecord.

    Although I do not encourage the use of it, I hope it helps.

提交回复
热议问题