requestLocationUpdates参数 [英] requestLocationUpdates parameters

查看:1452
本文介绍了requestLocationUpdates参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

多数民众赞成requestLocationUpdates的样子(我用它的方式):

Thats how the requestLocationUpdates looks like(the way I use it):

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

我的问题是,如果minTime和minDistance依旧之间的逻辑连接OR或AND。
如果minTime已通过将它等待minDistance依旧没有?

My question is if the logical connection between the minTime and the minDistance is OR or AND. If the minTime has passed will it wait for the minDistance or not?

或或和

推荐答案

借助文档在 requestLocationUpdate() 说:

的minDistance才会参数也可用于控制位置更新的频率。如果大于0那么当位置已至少minDistance才会米地点变更供应商将只发送您的应用程序的更新,并且至少minTime毫秒过去了

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值,您会收到更新。

So both parameters must be satisfied before you'll receive an update if you specify non-0 values.

这篇关于requestLocationUpdates参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆