Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Mobile Development > BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 27th, 2009, 10:29 PM
Registered User
 
Join Date: Jan 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Earthquake Example problem "non-application token"

I'm trying to run the Earthquake example from chapter 8, the v4 version.
And after I fixed the "vibrate permission problem", now in the emulator, when I select one of the earthquakes, the application has an "stopped unexpectedly". When I look in the debugger view of Eclipse, I can see that there was an uncaught exception related to a bad token "token null is not set for application"

Which in turn seems like it was caused by "Attempted to add window with non-application token WindowToken{434538d8 token=null}. Aborting."

Any ideas? This is running in the latest version of the emulator, running on linux/ubuntu (gutsy) with jdk1.6 and eclipse ganymede.

Thanks in advance for any pointers.
Reply With Quote
  #2 (permalink)  
Old January 27th, 2009, 10:41 PM
Registered User
 
Join Date: Jan 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Found the problem... the book was right

There are a couple of lines that are correct in the book but "wrong" in the downloadable example code.

In Earthquake.onCreateDialog()
change:
LayoutInflater li = LayoutInflater.from(getApplicationContext());
to
LayoutInflater li = LayoutInflater.from(this);

and
AlertDialog.Builder quakeDialog = new AlertDialog.Builder(getApplicationContext());
to
AlertDialog.Builder quakeDialog = new AlertDialog.Builder(this);
Reply With Quote
  #3 (permalink)  
Old January 28th, 2009, 02:29 PM
Reto's Avatar
Wrox Author
Points: 287, Level: 5
Points: 287, Level: 5 Points: 287, Level: 5 Points: 287, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2008
Location: London, United Kingdom
Posts: 61
Thanks: 1
Thanked 7 Times in 6 Posts
Default

Quote:
Originally Posted by Langley View Post
There are a couple of lines that are correct in the book but "wrong" in the downloadable example code.
Thanks for posting your findings, hopefully it'll help others who run into the same problem.

I'll update the downloads ASAP to reflect the corrections you've highlighted.

Thanks again!
__________________
Reto Meier

Author, "Professional Android 4 Application Development", Wrox, ©2012, 2010, 2008
@retomeier
Reply With Quote
Reply


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
WebPart not supporting/enabled displaymode other than "Browse" amitjoshipune ASP.NET 2.0 Professional 1 January 9th, 2009 02:34 PM
google Response.Write(Request.QueryString("q")) senol01 ASP.NET 2.0 Basics 1 January 2nd, 2009 12:01 PM
pgs. 506-512 "r" ? Rachel BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 January 2nd, 2009 05:02 AM
replacing " gantait XSLT 1 March 4th, 2007 10:44 AM
Replace Character " fosca XSLT 1 November 11th, 2004 04:14 PM



All times are GMT -4. The time now is 09:50 PM.


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