Android - NestedFragments participate in populating the options menu

后端 未结 2 984
一整个雨季
一整个雨季 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:47

    Yes they can.

    With android 4.2 or support library revisiion 11 nested fragments participate in populating options menu, as allways you need to call setHasOptionsMenu(true) during onCreate().

    But if you are using ActionBarSherlock they won't, you have to manually call from parent fragment onCreateOptionsMenu() nested fragment method onCreateOptionsMenu().

    Update: issue

提交回复
热议问题