Android - NestedFragments participate in populating the options menu

后端 未结 2 992
一整个雨季
一整个雨季 2021-02-19 04:54

i am implementing the new nested fragment feature and had stumble into a problem. my view is basically this: a main activity(A) that includes a fragment(

2条回答
  •  长发绾君心
    2021-02-19 05:32

    From my read of the source code, it appears that the implementations of FragmentManager and Activity only work with the root FragmentManager for adding to the options menu/action bar, not and child FragmentManager instances.

    Fragment B presumably will need to manage the options menu/action bar on behalf of the contents of the ViewPager, changing what is in the options menu/action bar based upon the pages being shown and hidden in the pager.

提交回复
热议问题