Hi Everyone,
This is a nice library but I'm having some trouble figuring out how to work it. In my main activity I used this coding in Activity_Create.
This code starts up the GPS.
In the starter I use this coding in GPS_LocationChanged.
When I start my app for the first time the GPS turns on and GPS_LocationChanged inside the starter executes as expected calling "LocationChanged" in the Main activity. That in turn calls another subroutine in the Main activity which eventually calls StopGps.
After the GPS is turned off there is a call to StartGps in another part of the app and the GPS starts up. I was expecting GPS_LocationChanged to be called just like it did when I started up the app for the first time but that event never executes. I'm assuming I'm missing a step here.
Can you tell me the additional coding I need so GPS_LocationChanged can execute after the GPS is started?
Thanks.
This is a nice library but I'm having some trouble figuring out how to work it. In my main activity I used this coding in Activity_Create.
B4X:
If Starter.GPS1.GPSEnabled = False Then
ToastMessageShow("Please enable the GPS device.", True)
StartActivity(Starter.GPS1.LocationSettingsIntent) 'Will open the relevant settings screen.
Else
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION)
End If
This code starts up the GPS.
In the starter I use this coding in GPS_LocationChanged.
B4X:
Sub GPS_LocationChanged (Location1 As Location)
CallSub2(Main, "LocationChanged", Location1)
End Sub
When I start my app for the first time the GPS turns on and GPS_LocationChanged inside the starter executes as expected calling "LocationChanged" in the Main activity. That in turn calls another subroutine in the Main activity which eventually calls StopGps.
After the GPS is turned off there is a call to StartGps in another part of the app and the GPS starts up. I was expecting GPS_LocationChanged to be called just like it did when I started up the app for the first time but that event never executes. I'm assuming I'm missing a step here.
Can you tell me the additional coding I need so GPS_LocationChanged can execute after the GPS is started?
Thanks.