Hi, Guys -
Just downloaded B4A v9.90 and now I have a problem with some code that ran without problems on previous versions.
Program hangs in the this code.
It may help the variable mLocator definition is in the Class_Globals
Log entries Just before it hangs
Like I said above, the App run OK on previous versions of B4A (going back to about 2017). Not sure if its the RunTimePermissions, FusedLocationProvider or MY MISTAKE!
Any suggestions
Kind regards
Dave Morris
Just downloaded B4A v9.90 and now I have a problem with some code that ran without problems on previous versions.
Program hangs in the this code.
This code hangs at line #17.:
Public Sub SelectCentre
RestartDisplayNewLocationTimer
If mLocator.IsInitialized Then ' Help to handle the bug #0180 Starting GPS
mLocator.Disconnect
End If
Log("Checking fine location permission...")
Dim perms As RuntimePermissions'
If perms.Check(perms.PERMISSION_ACCESS_FINE_LOCATION) = False Then
Dim msg As String = "This App will ask permission to use your device's location." & CRLF & _
"This information is used within the App to find local centres or to check you are in the centre." & CRLF & _
"It is not disclosed to any third parties!" & CRLF & CRLF & _
"THE APP CANNOT RUN WITHOUT YOU ALLOWING LOCATION"
xui.MsgboxAsync( msg, "Location permission")
wait for MsgBox_result(resultPermission As Int)
End If
perms.CheckAndRequest(perms.PERMISSION_ACCESS_FINE_LOCATION)
Wait For Activity_PermissionResult(permission As String, result As Boolean) ' <- hangs HERE!
If result Then ' Permission has been granted to use the location services
Log("Fine location permission OK. Connecting to location services...")
StartLocationService
mLocator.Connect ' This will then be handled in either mLocator_ConnectionSuccess() or mLocator_ConnectionFailed()
Else ' Location permission has been denied
xui.MsgboxAsync("The fine location permission has been denied. All centres will now be displayed.", "Cannot Get Location")
DisplayAllCentres
End If
End Sub
It may help the variable mLocator definition is in the Class_Globals
mLocator definition:
Private mLocator As FusedLocationProvider ' Object used to get the phone's location.
Log entries Just before it hangs
Log entries prior to App Hanging:
Checking fine location permission...
Object context is paused. Ignoring CallSubDelayed: JobDone
** Activity (aselectplaycentre2) Pause, UserClosed = false **
Like I said above, the App run OK on previous versions of B4A (going back to about 2017). Not sure if its the RunTimePermissions, FusedLocationProvider or MY MISTAKE!
Any suggestions
Kind regards
Dave Morris