View Single Post
  #1 (permalink)  
Old February 2nd, 2012, 05:52 AM
Mounika Mounika is offline
Registered User
Points: 17, Level: 1
Points: 17, Level: 1 Points: 17, Level: 1 Points: 17, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default chapter 7, earthquake, NullPointer Exception

Hi,
I have tried the Earthquake example in chapter 7 of this book...
And i'm getting Null Pointer Exception when i run in emulator..

This happens after i updated the code as in "USING THE PROVIDER" in page no. "236"..

Logcat shows as follows:
Quote:
02-02 15:12:12.219: E/ActivityThread(1154): Failed to find provider info for com.paad.provider.earthquake
02-02 15:12:12.219: D/AndroidRuntime(1154): Shutting down VM
02-02 15:12:12.231: W/dalvikvm(1154): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
02-02 15:12:12.301: E/AndroidRuntime(1154): FATAL EXCEPTION: main
02-02 15:12:12.301: E/AndroidRuntime(1154): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.quake/com.android.quake.Earthquake}: java.lang.NullPointerException
02-02 15:12:12.301: E/AndroidRuntime(1154): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:1956)
02-02 15:12:12.301: E/AndroidRuntime(1154): at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:1981)
02-02 15:12:12.301: E/AndroidRuntime(1154): at android.app.ActivityThread.access$600(ActivityThre ad.java:123)
02-02 15:12:12.301: E/AndroidRuntime(1154): at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1147)
02-02 15:12:12.301: E/AndroidRuntime(1154): at android.os.Handler.dispatchMessage(Handler.java:99 )
02-02 15:12:12.301: E/AndroidRuntime(1154): at android.os.Looper.loop(Looper.java:137)
02-02 15:12:12.301: E/AndroidRuntime(1154): at android.app.ActivityThread.main(ActivityThread.jav a:4424)
02-02 15:12:12.301: E/AndroidRuntime(1154): at java.lang.reflect.Method.invokeNative(Native Method)
02-02 15:12:12.301: E/AndroidRuntime(1154): at java.lang.reflect.Method.invoke(Method.java:511)
02-02 15:12:12.301: E/AndroidRuntime(1154): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:784)
02-02 15:12:12.301: E/AndroidRuntime(1154): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:551)
02-02 15:12:12.301: E/AndroidRuntime(1154): at dalvik.system.NativeStart.main(Native Method)
02-02 15:12:12.301: E/AndroidRuntime(1154):Caused by: java.lang.NullPointerException
02-02 15:12:12.301: E/AndroidRuntime(1154): at com.android.quake.Earthquake.loadQuakesFromProvide r(Earthquake.java:201)
02-02 15:12:12.301: E/AndroidRuntime(1154): at com.android.quake.Earthquake.onCreate(Earthquake.j ava:78)
02-02 15:12:12.301: E/AndroidRuntime(1154): at android.app.Activity.performCreate(Activity.java:4 465)
02-02 15:12:12.301: E/AndroidRuntime(1154): at android.app.Instrumentation.callActivityOnCreate(I nstrumentation.java:1049)
02-02 15:12:12.301: E/AndroidRuntime(1154): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:1920)
02-02 15:12:12.301: E/AndroidRuntime(1154): ... 11 more
Can any one plz help me with this...

Regards,
Mounika
Reply With Quote