In this chapter, the menu and context menu are set up in code. There is mention of setting them up in xml though and I am trying to do that. I can get the menus to work with xml but not if they are to be dynamic. I wrote the xml files as described in the book. The problem seems to come from onPrepareOptionsMenu(). Specifically it stops at:
MenuItem removeItem = menu.findItem(REMOVE_TODO);
What I mean is that I put breakpoints in at every line in that method and that's as far as it got before the program "stopped unexpectedly". It seems that a nullpointer reference exception is thrown. Also I took the mentioned line out completely and it doesn't crash. I think that it's not finding the menu item like it should. I don't know if I'm supposed to assign numbers some how to each menu item in my xml resources or what. If anyone can help I would really appreciate it. I've uploaded my project to mediafire:
http://www.mediafire.com/file/o1tdsy...t_Menu_XML.zip
Thanks.
