pop specific fragment from stack and remove others

前端 未结 5 1070
情话喂你
情话喂你 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 08:10

    You can call the function below while you are in Fragment E:

    getFragmentManager().popBackStack("tag", 0);
    

    Here the tag is string passed as tag while adding fragment B to backstack.

提交回复
热议问题