LocationRequest (FusedLocationProviderClient) - 已弃用
LocationRequest (FusedLocationProviderClient) - Deprecated
LocationRequest 现已弃用?它的替代品是什么?
我正在使用它,最近收到一条弃用消息。我现在该怎么办:
val locationRequest = LocationRequest().apply {
interval = LOCATION_UPDATE_INTERVAL
fastestInterval = LOCATION_FASTEST_INTERVAL
priority = LocationRequest.PRIORITY_HIGH_ACCURACY
}
fusedLocationProviderClient.requestLocationUpdates(
locationRequest,
locationCallback,
Looper.getMainLooper()
)
你可以这样使用它
val locationRequest = LocationRequest.create().apply {
interval = LOCATION_UPDATE_INTERVAL
fastestInterval = LOCATION_FASTEST_INTERVAL
priority = LocationRequest.PRIORITY_HIGH_ACCURACY
}
LocationRequest 现已弃用?它的替代品是什么?
我正在使用它,最近收到一条弃用消息。我现在该怎么办:
val locationRequest = LocationRequest().apply {
interval = LOCATION_UPDATE_INTERVAL
fastestInterval = LOCATION_FASTEST_INTERVAL
priority = LocationRequest.PRIORITY_HIGH_ACCURACY
}
fusedLocationProviderClient.requestLocationUpdates(
locationRequest,
locationCallback,
Looper.getMainLooper()
)
你可以这样使用它
val locationRequest = LocationRequest.create().apply {
interval = LOCATION_UPDATE_INTERVAL
fastestInterval = LOCATION_FASTEST_INTERVAL
priority = LocationRequest.PRIORITY_HIGH_ACCURACY
}