Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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..
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 12:13 AM.

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