Wrox Programmer Forums
BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2
This is the forum to discuss the Wrox book Professional Android Application Development by Reto Meier; ISBN: 9780470344712
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 19th, 2010, 10:28 PM
Registered User
Join Date: Aug 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch 4 menus and context menus

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:



So, I didn't realize this but I posted this in the wrong place. I am working out of Professional Android 2 Application Development. I still need help just the same if anyone can. Thanks.

Last edited by keepjumpin; August 21st, 2010 at 11:46 AM..

Similar Threads
Thread Thread Starter Forum Replies Last Post
Menus in Chrome, Ch 7 p244- Alanrf BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 9 May 17th, 2010 01:37 PM
showing javascript context menus outside frames... jxn Javascript How-To 5 February 3rd, 2006 07:53 PM
sub menus matshediso HTML Code Clinic 2 January 31st, 2005 05:15 AM
sliding menus Adam H-W Javascript 3 November 18th, 2003 09:38 AM
Menus Frank Schmuck BOOK: Beginning ASP.NET 1.0 1 June 6th, 2003 01:29 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.