Gre*_*g B 5 android locationmanager locationlistener
如何取消订阅LocationListener收到的更新LocationManager?
这是我如何设置它
mLocationManager = (LocationManager)this.getSystemService(LOCATION_SERVICE);
mListener = new LocationListener() {
public void onLocationChanged(Location location) {
Log.i("LocationListener", "Logging Change");
}
}
mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
5000, 1, mListener);
Run Code Online (Sandbox Code Playgroud)
在我退出创建的视图后,LocationListener我仍在LogCat窗口中获取日志消息.
我明白这是因为我正在孤立侦听器,但我看不到任何破坏方法,LocationListener也不能在LocationManager对象上看到任何"删除侦听器"样式方法.
| 归档时间: |
|
| 查看次数: |
8753 次 |
| 最近记录: |