本文整理了Java中com.google.android.gms.location.FusedLocationProviderApi.getLocationAvailability()
方法的一些代码示例,展示了FusedLocationProviderApi.getLocationAvailability()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FusedLocationProviderApi.getLocationAvailability()
方法的具体详情如下:
包路径:com.google.android.gms.location.FusedLocationProviderApi
类名称:FusedLocationProviderApi
方法名:getLocationAvailability
暂无
代码示例来源:origin: yayaa/LocationManager
@SuppressWarnings("ResourceType")
boolean getLocationAvailability() {
LocationAvailability locationAvailability =
LocationServices.FusedLocationApi.getLocationAvailability(googleApiClient);
return locationAvailability != null && locationAvailability.isLocationAvailable();
}
代码示例来源:origin: klaasnotfound/LocationAssistant
private boolean checkLocationAvailability() {
if (!googleApiClient.isConnected() || !permissionGranted) return false;
try {
LocationAvailability la = LocationServices.FusedLocationApi.getLocationAvailability(googleApiClient);
return (la != null && la.isLocationAvailable());
} catch (SecurityException e) {
if (!quiet)
Log.e(getClass().getSimpleName(), "Error while checking location availability:\n " + e.toString());
if (listener != null)
listener.onError(ErrorType.RETRIEVAL, "Could not check location availability:\n" +
e.getMessage());
return false;
}
}
代码示例来源:origin: florent37/RxGps
@Override
protected void onGoogleApiClientReady(GoogleApiClient apiClient, SingleEmitter<Boolean> emitter) {
//noinspection MissingPermission
LocationAvailability locationAvailability = LocationServices.FusedLocationApi.getLocationAvailability(apiClient);
if (locationAvailability != null) {
emitter.onSuccess(locationAvailability.isLocationAvailable());
} else {
emitter.onSuccess(false);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!