Delete one specific fragment from the Android backstack

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

    This solution only works for your case. You needn't put Fragment2 into backstack.What you can do is removing the code 'ft.addToBackStack("Fragment2");'. The Fragment2 is not in the stack.So you close the Fragment2, and leave [fragment 3] on the screen.

提交回复
热议问题