I received an error report with the following stack trace for an app I have in the Android Market:
java.lang.RuntimeException: Unable to start service com.k0gappsw.skibuddy.SBService@4051f4d0 with null: java.lang.NullPointerException
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2473)
at android.app.ActivityThread.access$2800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1127)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:4385)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.k0gappsw.skibuddy.SBService.onStartCommand(SBService.java:316)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2456)
... 10 more
I have two questions:
1. Is the offending code at line 316 of SBService.java?
2. The code at that line is:
Bundle bundle = intent.getExtras();
Any idea what could be going wrong with this? I have not seen the problem in my testing.
Don’t you love mysterious stack traces that come in with random error reports! I’ll take a stab at answering your questions: