通过以下代码启动监听器后工作正常.
LocationManager locationManager =(LocationManager) getSystemService(Context.LOCATION_SERVICE); locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER,WLConstants.DELAY_HOUR,gpsl .getMinDistance(),gpsl);
一段时间后,我通过以下代码停止监听器
locationManager.removeUpdates(this);
解决方法
@H_301_13@ 您需要将实现您请求位置更新的LocationListener的同一对象传递给locationManager.removeUpdates()方法.所以,除非这和gpsl是同一个,你应该调用:
locationManager.removeUpdates(gpsl);