Skip to content Skip to sidebar Skip to footer

Onoptionsitemselected Isn't Being Called

I have this called on my Fragment @Override public boolean onOptionsItemSelected(MenuItem item) { Toast.makeText(getActivity(), 'otem: ' + item.getItemId(), Toast.LENGT

Solution 1:

Did you call this.setHasOptionsMenu(true); in onCreate()?

Report that this fragment would like to participate in populating the options menu by receiving a call to onCreateOptionsMenu(Menu, MenuInflater) and related methods.

Docs:http://developer.android.com/reference/android/app/Fragment.html#setHasOptionsMenu(boolean)

More Reading:http://developer.android.com/guide/components/fragments.html#ActionBar

Post a Comment for "Onoptionsitemselected Isn't Being Called"