Occationally users report a NullPointerException Error at MyService.onStartCommand() for some of my apps. I never see this error when I try to debug the apps, and I wonder why this happens. I have studied the code both for the methods onStartCommand() and onCreate() for the services in question, but I seem unable to find the cause of the problem. I suspect that the actual reason for the crash lies elsewhere.
Here is the stack trace, which seems to be identical for all crashes on ALL of the apps in question: java.lang.RuntimeException: Unable to start service xxxx.xxxx.xxxx.MyService@405274c8 with null: java.lang.NullPointerException at android.app.ActivityThread.handleServiceArgs(ActivityThread.java: 2481) at android.app.ActivityThread.access$2800(ActivityThread.java:145) at android.app.ActivityThread$H.handleMessage(ActivityThread.java: 1118) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:150) at android.app.ActivityThread.main(ActivityThread.java:4369) 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:846) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:604) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at xxxx.xxxx.xxxx.MyService.onStartCommand(MyService.java:279) at android.app.ActivityThread.handleServiceArgs(ActivityThread.java: 2464) As the Google error report system does not include device type or Android os version, I do not know if this occurs only one some specific devices or os version. Has anyone got an idea as to what is happening? Thank you. Terry -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en