Android Question gmap.MyLocation for Longitude and Latitude equal to zero

I store the values of gmap.MyLocation.Latitude and Longitude in a variable but there are times that they are both equal to zero. What could be the problem?

B4X:
Wait For MapFragment1_Ready
        gmap = MapFragment1.GetMap
        rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
        Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
        If Result Then
            gmap.MyLocationEnabled = True
            If gmap.IsInitialized Then
                Do While gmap.MyLocation.IsInitialized = False
                    Sleep(0)
                Loop
                Dim cp As CameraPosition
                cp.Initialize(gmap.MyLocation.Latitude, gmap.MyLocation.Longitude, 15)
                gmap.MoveCamera(cp)
            End If
        Else
            Log("No permission!")
        End If
        
    strLatitude = gmap.MyLocation.Latitude
    strLongitude = gmap.MyLocation.Longitude
 
Top