FusedLocationApi已被越过或弃用

时间:2018-06-16 15:11:03

标签: android-fusedlocation

我真的必须找到一种方法来使用或找到替代交叉线的东西,即FusedLocationApi

我希望你能给我一个答案

 public void onConnected(@Nullable Bundle bundle) {
 locationRequest = new LocationRequest;

 locationRequest.setInterval(1000);
 locationRequest.setFastestInterval(1000);
 locationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
 if(ContextCompat.checkSelfPermission(this,Manifest.permission.ACCESS_FINE_LOCATION==PackageManager.PERMISSION_GRANTED){
     LocationServices.FusedLocationApi.requestLocationUpdates(client,locationRequest,this);
}
}

1 个答案:

答案 0 :(得分:0)

使用getFusedLocationProviderClient代替LocationServices.FusedLocationApi。检查此post