0

I am seeing in my Google Play Console that one of my users had 45 errors of the type:

    java.lang.NullPointerException: 
  at com.XXXXXXXXXX.bluetooth_control.MainActivity$1.handleMessage(MainActivity.java:368)
  at android.os.Handler.dispatchMessage(Handler.java:102)
  at android.os.Looper.loop(Looper.java:154)
  at android.app.ActivityThread.main(ActivityThread.java:6688)
  at java.lang.reflect.Method.invoke(Native Method:0)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

I have not been able to reproduce this. It looks like the handler is null when it is being called. It is defined in the main activity, and called from a Bluetooth service to relay messages about connection status, etc. Any ideas how it can be null when instantiated in the Main Activity? Is there something I have to add in OnCreate? The service is instantiated in OnCreate. I am new to this, so any help would be appreciated. Thank you, Tom

tommyvdp
  • 41
  • 5

0 Answers0