安卓:LocationManager.requestLocationUpdates不尊重PARAMS [英] Android: LocationManager.requestLocationUpdates doesn't respect params

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

问题描述

我有一个设定的时间段后recieving从的LocationManager通知的问题:

I have a problem recieving notifications from LocationManager after a set period of time:

    locationManager = (LocationManager)getSystemService(LOCATION_SERVICE);
    if(useGPS) {
        locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 999999, 
                999999, locationListener);

在模拟器每当我通过仿真器控制发送修复我的位置监听器的onLocationChanged方法被调用(即每隔一秒)
所以,问题是 - 这是因为这样我测试的模拟器,或的LocationManager不尊重PARAMS?

In emulator my location listener's onLocationChanged method gets called whenever I send a fix via emulator control (i.e. every other second) So, the question is - is this because the way I'm testing on emulator, or LocationManager doesn't respect params?

感谢

推荐答案

该医生说:

minTime - 接收通知的最小时间间隔,以毫秒为单位。 此字段只用作提示以节省电力和位置更新之间的实际时间可能比这个值更大或更小。

minTime - the minimum time interval for notifications, in milliseconds. This field is only used as a hint to conserve power, and actual time between location updates may be greater or lesser than this value.

这篇关于安卓:LocationManager.requestLocationUpdates不尊重PARAMS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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