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
{{ message }}
Repository navigation
SettingsClient returns failure when Location is enabled on device #398
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)
Activity