pop specific fragment from stack and remove others

前端 未结 5 1068
情话喂你
情话喂你 2020-12-30 07:32

how I can pop specific fragment from stack and remove others from a fragment? for example these are my fragments and I\'m in E right know.

A-> B -> C -> D ->E

<
5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-30 07:55

    If you are using AndroidX navigation, you can use the following:

    findNavController().popBackStack(R.id.FragmentB, false)
    

提交回复
热议问题