android 其中声明了恒定的优先级,PRIORITY_BALANCED_POWER_ACCURACY?

s4n0splo  于 2023-04-10  发布在  Android
关注(0)|答案(1)|浏览(105)

当我读到doc:https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest然后说PRIORITY_BALANCED_POWER_ACCURACY已被弃用,我们必须使用Priority.PRIORITY_BALANCED_POWER_ACCURACY。但是当我这样做时,我收到:
错误:找不到符号
.setPriority(Priority.PRIORITY_BALANCED_POWER_ACCURACY)
我错过了什么?

5lwkijsr

5lwkijsr1#

此外,LocationRequest.setPriority()已被弃用,并被LocationRequest.Builder.setPriority()取代,其中
默认值为Priority.PRIORITY_BALANCED_POWER_ACCURACY
因此,在您的情况下,根本不需要调用setPriority()
进一步注意,PRIORITY_BALANCED_POWER_ACCURACY已从classLocationRequest移动到interfacePriority

相关问题