I\'m reading through Android For Dummies. One example makes use of the onCreateOptionsMenu (I\'ve added a log message):
@Override
public boolean onCreateOptionsM
Call the super method after inflating it
@Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater mi = getMenuInflater(); mi.inflate(R.menu.list_menu, menu); return super.onCreateOptionsMenu(menu); }
onCreateOptionsMenu() is called when activity created .We dont need to call it explicitly. Check whether your activity has title bar or not.If dont then make it visible or remove no title bar property in activity.Try it may it work.
This question is answered here:
My menu in my activity is not appearing because my onCreateOptionsMenu is not getting called
I had the same problem whilst studying this book. The code is right, but you have to press the menu button in order for it to appear. :)
I would remove the line super.onCreateOptionsMenu(menu);
and try it again. This is also exemplified in Androids Inflating a Menu Resource section.