onCreateOptionsMenu not being called on FragmentActivity when run on phone version

后端 未结 1 960
陌清茗
陌清茗 2020-12-15 05:03

I create an app that supports both phone and tablet version so i use the android-support-v4.jar library. My activity extends the FragmentActivity and override the onCreateOp

相关标签:
1条回答
  • 2020-12-15 05:47

    You should consider from your Fragment code:

    1) Implementing onCreateOptionsMenu(Menu menu, MenuInflater inflater)

    2) Calling setHasOptionsMenu

    3) And also implementing onOptionsItemSelected(MenuItem item)

    Then you will be ok on both the phone and tablet.

    0 讨论(0)
提交回复
热议问题