LocationServices.SettingsApi calls onActivityResult with RESULT_CANCELED

I struggled with a new LocationServices.SettingsApione in a particular case.

Assume that on your device, the Location settings are on and the Airplane mode is on . Now, if you check LocationRequest.PRIORITY_HIGH_ACCURACYwith LocationServices.SettingsApi.checkLocationSettings, it will get status 6 RESOLUTION_REQUIRED.

If I receive RESOLUTION_REQUIRED, I call startResolutionForResult, which shows a new settings hint prompting the user to enable Wi-Fi check and other things. If by pressing YES this one onActivityResultis called with resultCode as RESULT_CANCELED, it should have been called with resultCode asRESULT_OK

+4
source share

Source: https://habr.com/ru/post/1589392/


All Articles