我的活动实现LocationListener的如下安卓:释放GPS
public class LoginActivity extends Activity implements LocationListener {}
我的LocationManager去如下
mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, MINIMUM_TIME_BETWEEN_UPDATES, MINIMUM_DISTANCE_CHANGE_FOR_UPDATES, this);
我可以使用有关该方法的当前GPS位置。
现在我需要在活动关闭时释放GPS。
所以我的onPause方法如下。
@Override
protected void onPause() {
mlocManager.removeUpdates(this);
//System.exit(0);
super.onPause();
}
但是,这并不释放GPS。有人可以帮我吗。提前致谢。