(Deprecated) Fragment onOptionsItemSelected not being called

后端 未结 9 2191
孤城傲影
孤城傲影 2020-11-28 20:45

EDIT: This question was for the deprecated sherlock action bar. Android support library should be used instead now

I have added an action bar menu o

9条回答
  •  醉酒成梦
    2020-11-28 21:30

    You are not chaining to the superclass in the activity methods. Please have onCreateOptionsMenu() return super.onCreateOptionsMenu(menu), and have onOptionsItemSelected() return super.onOptionsItemSelected(item) (except for the item that you are handling, which should return true to indicate that you have handled the event)

提交回复
热议问题