gpt4 book ai didi

android - LocationRequest (FusedLocationProviderClient) - 已弃用

转载 作者:行者123 更新时间:2023-12-05 00:18:46 26 4
gpt4 key购买 nike

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
}

关于android - LocationRequest (FusedLocationProviderClient) - 已弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66503088/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com