0

i get user reports that the app crash in the online console i find several crash logs like

java.lang.RuntimeException: Unable to start service
com.chris.mydays.UpdateWidgets@428eb2d8 with null:
java.lang.NullPointerException at
android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2555)
at android.app.ActivityThread.access$1900(ActivityThread.java:139) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1328)
at android.os.Handler.dispatchMessage(Handler.java:99) at
android.os.Looper.loop(Looper.java:137) at
android.app.ActivityThread.main(ActivityThread.java:5021) at
java.lang.reflect.Method.invokeNative(Native Method) at
java.lang.reflect.Method.invoke(Method.java:511) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556) at
dalvik.system.NativeStart.main(Native Method) Caused by:
java.lang.NullPointerException at
com.chris.mydays.UpdateWidgets.onStart(UpdateWidgets.java:50) at
android.app.Service.onStartCommand(Service.java:450) at
android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2538)
... 10 more

any idea whats about and i can do?

thanks chris

8
  • Something is assigned to NULL at com.chris.mydays.UpdateWidgets.onStart(UpdateWidgets.java:50) Commented Jan 23, 2014 at 21:02
  • It will be nice if you share your code especialy where your null pointer is thrown. Commented Jan 23, 2014 at 21:03
  • Holy crap this from the my days app that my ex girlfriend used to track all that awesome girl stuff. Golden. If the widget is updating from a server side call my guess could be that it's not getting data that you're expecting it to have Commented Jan 23, 2014 at 21:03
  • 1
    @JakeWilson801 Wrong color. Commented Jan 23, 2014 at 21:04
  • @jakeWilson801.. right its MyDays :) hope it worked for ur ex. and no, its nothing loaded from a server side Commented Jan 23, 2014 at 21:39

1 Answer 1

1

I think the most significant lines are these two:

com.chris.mydays.UpdateWidgets.onStart(UpdateWidgets.java:50) at android.app.Service.onStartCommand(Service.java:450) at

So I'd open your UpdateWidgets.java file and go to line 50, which should be in a Service in the onStartCommand() method.

Sign up to request clarification or add additional context in comments.

4 Comments

49 Bundle extras; 50 if ((extras = intent.getExtras()) != null) { i even check at line 50 if its null
But if it's null you're first assigning and then comparing (precedence priorities). So if it's null this will throw an exception. I'd first compare and once I've checked it's not null, then assign.
Can't you check whether Intent is null? How did you get it?
Of course he can, that's exactly what I'm saying! But in his code he's doing two operations within a single line: a comparation and an assignation, and that's where the danger is. If the intent is null, he's assigning something that doesn't exist, that's why I recommended checking first and assigning then.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.