我使用这个代码来获取gps传感器数据。
mlocManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
mlocListener = new MyLocationListener();
mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, 1, mlocListener);为什么我的gps图标不断地打开和关闭?
发布于 2012-07-22 21:30:36
2000毫秒大约相当于0.0333333秒。在您的代码中,您每隔0.0333333秒请求一次位置更新。
mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, 1, mlocListener);这意味着GPS并不总是需要自我更新。这就是为什么GPS图标不断地打开和关闭。
https://stackoverflow.com/questions/11104192
复制相似问题