locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,10000,10,locationListener);
希望是10秒钟触发一次,可是每当坐标改变时就触发了,,为什么啊??????

解决方案 »

  1.   

    api文档上对这个参数是这样说明的:
    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
      

  2.   

    就是说有可能比minTime长也可能短。
    你可以通过handler来10s中调用一次requestLocationUpdates
      

  3.   

    我想用service一直运行,时间设置多少比较合适啊??
      

  4.   

    我是说在service里起一个定时器
      

  5.   

    在service里面启动一个Thread,在run中sleep(10000);后执行handler.sendMessage(),更新位置
      

  6.   

    楼上有没有解决了这个问题的    我写成3秒钟   结果每秒钟都在发送。。
    “在service里面启动一个Thread,在run中sleep(10000);后执行handler.sendMessage(),更新位置”
    这个方法  有过的有木有 可行不?
      

  7.   

    为什么GPS.CONF老是有时候找不着