Android Question error implementing GPS

cwt

Active Member
Licensed User
Longtime User
I am trying to add GPS to my app using the GPS tutorial.

I get this runtime error:

java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.location.LocationManager.isProviderEnabled(java.lang.String)' on a null object reference

The error happens on the first line of the Activity_Resume sub in the Main module:

Sub Activity_Resume
If start_gps.GPS1.GPSEnabled = False Then
ToastMessageShow("Please enable the GPS device.", True)
StartActivity(start_gps.GPS1.LocationSettingsIntent) 'Will open the relevant settings screen.
Else
start_gps.rp.CheckAndRequest(start_gps.rp.PERMISSION_ACCESS_FINE_LOCATION)
End If
End Sub

Please help.
 
Top