gpt4 book ai didi

java - requestLocationUpdates 参数

转载 作者:太空宇宙 更新时间:2023-11-03 11:51:11 25 4
gpt4 key购买 nike

这就是 requestLocationUpdates 的样子(我使用它的方式):

requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener)

我的问题是 minTime 和 minDistance 之间的逻辑关系是 OR 还是 AND。如果 minTime 已经过去,它是否会等待 minDistance?

或或与

最佳答案

documentation on requestLocationUpdate()说:

The minDistance parameter can also be used to control the frequency of location updates. If it is greater than 0 then the location provider will only send your application an update when the location has changed by at least minDistance meters, AND at least minTime milliseconds have passed

因此,如果您指定非 0 值,则必须满足这两个参数才能收到更新。

关于java - requestLocationUpdates 参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14380494/

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