onCreateOptionsMenu is never called

后端 未结 11 1069
有刺的猬
有刺的猬 2020-12-13 03:13

I am having some trouble getting an options menu working in Android. I have built apps before, and they all worked fine, but now the menu just doesn\'t pop up.

The c

11条回答
  •  無奈伤痛
    2020-12-13 04:08

    In the method: Fragment#onCreateView(...) you should put:

    setHasOptionsMenu(true);
    

    Then your method will be called.

提交回复
热议问题