Ativar serviços de localização para Android se o usuário escolher a opção Nunca
Existe alguma maneira de permitir serviços de localização novamente para um aplicativo (ou pelo menos mostrar a caixa de diálogo) se o usuário tiver escolhido anteriormente a opção Nunca?
Não encontro nenhuma maneira no código para mostrá-lo novamente, pois sempre recebo LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE no retorno de chamada onResult (..):
@Override
public void onResult(LocationSettingsResult locationSettingsResult) {
final Status status = locationSettingsResult.getStatus();
switch (status.getStatusCode()) {
case LocationSettingsStatusCodes.SUCCESS:
Log.i(TAG, "All location settings are satisfied.");
// startLocationUpdates();
break;
case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:
Log.i(TAG, "Location settings are not satisfied. Show the user a dialog to" +
"upgrade location settings ");
try {
// Show the dialog by calling startResolutionForResult(), and check the result
// in onActivityResult().
status.startResolutionForResult(activity, REQUEST_CHECK_SETTINGS);
} catch (IntentSender.SendIntentException e) {
Log.i(TAG, "PendingIntent unable to execute request.");
}
break;
case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:
Log.i(TAG, "Location settings are inadequate, and cannot be fixed here. Dialog " +
"not created.");
break;
}
}
A única solução que encontrei é reinstalar o aplicativo ou limpar dados.