You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First issue here that onFailure() is called when location is enabled on device(but in this case onSuccessListener should be called).
Bad, but then user still will see dialog to enable location and after he taps "OK", i am trying to request location updates :
**// ITS ALWAYS TRUE**
if (locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER) ||
locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)
) {
val callback = object : LocationCallback() {
override fun onLocationResult(locationResult: LocationResult?) {
locationClient.removeLocationUpdates(this) ....
}
override fun onLocationAvailability(p0: LocationAvailability?) {
super.onLocationAvailability(p0)
**// BUT ALWAYS APPEAR HERE with p0.isLocationAvailable==false**
}
}
locationClient.requestLocationUpdates(
locationRequest,
callback,
Looper.myLooper()
)
}
So second issue that even locationManager.isProviderEnabled(GPS||NETWORK) always returns true (so location enabled as it is), but just onLocationAvailability(p0: LocationAvailability?) is called (where p0.isLocationAvailable==false)
The text was updated successfully, but these errors were encountered:
Facing issue with SettingsClient.
Due to https://developer.android.com/training/location/change-location-settings i did following request to ask user enable location when its disabled:
First issue here that onFailure() is called when location is enabled on device(but in this case onSuccessListener should be called).
Bad, but then user still will see dialog to enable location and after he taps "OK", i am trying to request location updates :
So second issue that even locationManager.isProviderEnabled(GPS||NETWORK) always returns true (so location enabled as it is), but just onLocationAvailability(p0: LocationAvailability?) is called (where p0.isLocationAvailable==false)
The text was updated successfully, but these errors were encountered: