在某些VIVO手机中获取位置时出现错误。
在类LocationSettingsResult回调中的DEVELOPER_ERROR(statusCode = 10)
下面是代码。
if (locationSettingsResult != null) {
locationSettingsResult.setResultCallback(locationSettingsResult1 -> {
final Status status = locationSettingsResult1.getStatus();
switch (status.getStatusCode()) {
case LocationSettingsStatusCodes.SUCCESS:
showRemarksDialogIfRequired();
break;
case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:
try {
if (status.hasResolution()) {
status.startResolutionForResult(parentActivity, 333);
}
} catch (IntentSender.SendIntentException e) {
// Ignore the error.
e.printStackTrace();
}
break;
case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:
Toast.makeText(parentActivity, "Can not set GPS settings for location!!!", Toast.LENGTH_SHORT).show();
break;
}
});
}