0

我只是无法删除我的应用程序中的位置监听。我在 onCreate 方法中使用它:

locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE); 
locationListener = new MyLocationListener();
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, 10, locationListener);

这在我的 onPause/onStop/onDestroy 方法中:

locationManager.removeUpdates(locationListener);

但是当我关闭我的应用程序时,卫星图标仍然存在。为什么?

4

1 回答 1

0

Solved by a new onResume method:

protected void onResume() {
    super.onResume();
    locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, 10, locationListener);
}
于 2012-07-17T20:41:47.897 回答