Failed to fetch status updates

Forums » Android - Learning Android book > Failed to fetch status updates
August 31, 2011 1:24:18 PM PDT (one year ago). Seen 926 times. 3 replies.
Photo Simon Zet
Non
Member since Aug 31, 2011
Forum Posts: 1
Hi there,
I've got some problems after passing the book without big problem, but that one makes me sick ;p

ERROR/YambaApplication(471): java.lang.NullPointerException
ERROR/YambaApplication(471): at org.yamba.YambaApplication.fetchStatusUpdates(YambaApplication.java:68)
ERROR/YambaApplication(471): at org.yamba.UpdaterService$Updater.run(UpdaterService.java:78)

Line 68 points to:
long latestStatusCreatedAtTime = this.getStatusData().getLatestStatusCreatedAtTime();

and line 78 points on:
int newUpdates = yamba.fetchStatusUpdates();

please help me :(
I'm at the end of charpter 9: The Databases
September 2, 2011 4:37:03 PM PDT (one year ago)
Photo Marko Gargenta
@MarkoGargenta
Marakana, Inc.
Member since Jan 19, 2007
Location: San Francisco
Forum Posts: 227
NullPointerException means you are sending a message to a null. So, try to figure out what is null and why. Looks like statusData may not be initialized, or similar. Should be easy to track down this type of error.
September 24, 2011 10:53:15 PM PDT (one year ago)
Photo Ashen Randika
Mr
University of Moratuwa
Member since Sep 24, 2011
Forum Posts: 1
Hello Simon,
You may be missing
this.statusData = new StatusData(this);
of onCreate() method of YambaApplication.java
May 23, 2012 11:01:21 PM PDT (51 weeks ago)
Photo Ionut Craioveanu
None
Member since May 23, 2012
Forum Posts: 2
Hello guys,
YES ... that's exactly the problem.
Anyhow, i have searched in the book i have and i could not find it. It would be great if you update it.