Which method is being called after popBackStack?

前端 未结 6 572
误落风尘
误落风尘 2020-12-29 04:13

I have an activity where I am calling three fragments - each depending on each other:

A(ctivity) -> f1 (Fragment one, title {is|should}: list) -> f2 (Fragment two,

6条回答
  •  不知归路
    2020-12-29 04:39

    I use following workaround:

    1) set 1st fragment setHasOptionsMenu(false) before add 2nd fragment on top of 1st one.

    2) set 1st fragment setHasOptionsMenu(true) in onOptionsItemSelected() after return from 2nd fragment.

    3) onCreateOptionsMenu() of 1st fragment should be called and you can change actionbar here.

    But I want to know a better solution.

提交回复
热议问题