How to close the current fragment by using Button like the back button?

前端 未结 13 909
失恋的感觉
失恋的感觉 2020-12-07 14:02

I have try to close the current fragment by using Imagebutton.

I am in Fragment-A and it will turn to the Fragment-B when I click the button.

And when I clic

13条回答
  •  广开言路
    2020-12-07 14:35

    getActivity().onBackPressed does the all you need. It automatically calls the onBackPressed method in parent activity.

提交回复
热议问题