【发布时间】:2022-05-27 20:17:59
【问题描述】:
我正在使用上面提到的方法
mFusedLocationClient = LocationServices.getFusedLocationProviderClient(context);
mFusedLocationClient.getCurrentLocation(LocationRequest.PRIORITY_HIGH_ACCURACY,null).addOnSuccessListener(new OnSuccessListener<Location>() {
@Override
public void onSuccess(Location location) {
if (location != null) {
userCurrentLatLng = new LatLng(location.getLatitude(), location.getLongitude());
getAddress(userCurrentLatLng);
}
}
});
在取消令牌参数中,我传递的是 null,所以这会产生任何影响,还是我必须在此处传递取消令牌。我仍在获取当前位置。
请建议我是否必须传递参数或 null 就可以了。
【问题讨论】:
标签: android-studio fusedlocationproviderapi