Delete one specific fragment from the Android backstack

前端 未结 4 1657
离开以前
离开以前 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:12

    You could simply make your own back stack and override onBackPressed() and handle it in any fashion you see fit. I don't think there is any other way to achieve the desired behavior.

    Your own back stack could simply be an ArrayList of tags for your fragments.

提交回复
热议问题