mirror of
https://github.com/ZCShou/GoGoGo.git
synced 2026-06-05 21:00:50 +08:00
优化
This commit is contained in:
parent
1412f94d4e
commit
71bbd9b48b
@ -212,15 +212,15 @@ public class MainActivity extends BaseActivity
|
||||
protected void onPause() {
|
||||
XLog.i("MainActivity: onPause");
|
||||
mMapView.onPause();
|
||||
super.onPause();
|
||||
mSensorManager.unregisterListener(this);
|
||||
mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL);
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
XLog.i("MainActivity: onResume");
|
||||
mMapView.onResume();
|
||||
mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL);
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
@ -242,9 +242,10 @@ public class MainActivity extends BaseActivity
|
||||
stopService(serviceGoIntent);
|
||||
}
|
||||
|
||||
mSensorManager.unregisterListener(this);
|
||||
|
||||
// 退出时销毁定位
|
||||
mLocClient.stop();
|
||||
|
||||
// 关闭定位图层
|
||||
mBaiduMap.setMyLocationEnabled(false);
|
||||
mMapView.onDestroy();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user