forked from upstream-mirrors/OpenTracks
bind and unbind recording service in onStart and onStop
This commit is contained in:
@@ -96,14 +96,14 @@ public class SensorStateActivity extends AbstractMyTracksActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.sensor_state;
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
TrackRecordingServiceConnectionUtils.startConnection(this, trackRecordingServiceConnection);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
TrackRecordingServiceConnectionUtils.resumeConnection(this, trackRecordingServiceConnection);
|
||||
isVisible = true;
|
||||
timer = new Timer();
|
||||
timer.schedule(new UpdateTimerTask(), 0, REFRESH_PERIOD_MS);
|
||||
@@ -120,11 +120,16 @@ public class SensorStateActivity extends AbstractMyTracksActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
trackRecordingServiceConnection.unbind();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.sensor_state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops the temp sensor manager.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user