forked from upstream-mirrors/OpenTracks
Bugfix: NPE.
This commit is contained in:
@@ -68,6 +68,7 @@ public class StatsFragment extends Fragment implements TrackDataListener {
|
|||||||
private TrackDataHub trackDataHub;
|
private TrackDataHub trackDataHub;
|
||||||
private Handler handlerUpdateUI;
|
private Handler handlerUpdateUI;
|
||||||
|
|
||||||
|
//TODO Initialize immediately and remove in onDestroy()
|
||||||
private TrackRecordingServiceConnection trackRecordingServiceConnection;
|
private TrackRecordingServiceConnection trackRecordingServiceConnection;
|
||||||
|
|
||||||
private Location lastLocation = null;
|
private Location lastLocation = null;
|
||||||
@@ -237,7 +238,9 @@ public class StatsFragment extends Fragment implements TrackDataListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onStop() {
|
public void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
trackRecordingServiceConnection.unbind();
|
if (trackRecordingServiceConnection != null) {
|
||||||
|
trackRecordingServiceConnection.unbind();
|
||||||
|
}
|
||||||
trackRecordingServiceConnection = null;
|
trackRecordingServiceConnection = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ public class TrackRecordingServiceConnection implements ServiceConnection, Death
|
|||||||
|
|
||||||
private static final String TAG = TrackRecordingServiceConnection.class.getSimpleName();
|
private static final String TAG = TrackRecordingServiceConnection.class.getSimpleName();
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
//TODO Always the context of the owner of a service connection (i.e., let it be passed to every call).
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final Runnable callback;
|
private final Runnable callback;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user