Android Question What's causing this crash? (GPS)

Android Dude

Member
Licensed User
This has been working fine, with GPS1.start(0, 0), but when I changed to GPS1.start(0, 1), I'm getting this crash occasionally...

B4X:
b4xmainpage_gps_locationchanged (java line: 282)
java.lang.RuntimeException: Object should first be initialized (Location).
    at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
    at b4a.example.b4xmainpage._gps_locationchanged(b4xmainpage.java:282)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
    at anywheresoftware.b4a.gps.GPS$1.onLocationChanged(GPS.java:65)
    at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:371)
    at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java:300)
    at android.location.LocationManager$ListenerTransport$1.handleMessage(LocationManager.java:316)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:215)
    at android.app.ActivityThread.main(ActivityThread.java:6939)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:870)
*** Service (starter) Create ***
** Service (starter) Start **

My GPS_LocationChanged function is in Main between lines 109 and 134, so not sure what "java line: 282" is pointing to. Some internal code, but I'm not sure how to correlate that to where/what in my code is causing this.
 
Top