Fragment addToBackStack() and popBackStackImmediate() not working

前端 未结 6 2019
清酒与你
清酒与你 2020-12-08 20:00

I am currently building an application for Android (14 <= SDK <= 21) by using one ActionBarActivity and more Fragments, such as ListFra

6条回答
  •  庸人自扰
    2020-12-08 20:39

    the reason why the popBackStack() and popBackStackImmediatly() is due to the fact that you didnt add that fragment (that you want to pop) to the backStack. In order to do this you have to make a call to addToBackStack() at the moment of making the transaction to add/replace your fragment.

提交回复
热议问题