fixes a crash when resuming a track with zero (or one) waypoint(s)
parent
9e08446436
commit
27508ce8cc
|
@ -395,7 +395,7 @@ public class TrackerService extends Service implements TrackbookKeys, SensorEven
|
||||||
|
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
Location previousLocation = null;
|
Location previousLocation = null;
|
||||||
int trackSize = mTrack.getWayPoints().size();
|
int trackSize = mTrack.getSize();
|
||||||
|
|
||||||
if (trackSize == 0) {
|
if (trackSize == 0) {
|
||||||
// if accurate AND current
|
// if accurate AND current
|
||||||
|
@ -430,9 +430,11 @@ public class TrackerService extends Service implements TrackbookKeys, SensorEven
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
if (mResumedFlag) {
|
if (mResumedFlag) {
|
||||||
// mark last location as stop over
|
int lastWayPoint = mTrack.getSize() - 2;
|
||||||
int lastWayPoint = mTrack.getWayPoints().size() - 2;
|
if (lastWayPoint >= 0) {
|
||||||
mTrack.getWayPoints().get(lastWayPoint).setIsStopOver(true);
|
// mark last location as stop over
|
||||||
|
mTrack.getWayPoints().get(lastWayPoint).setIsStopOver(true);
|
||||||
|
}
|
||||||
mResumedFlag = false;
|
mResumedFlag = false;
|
||||||
} else {
|
} else {
|
||||||
// update distance, if not resumed
|
// update distance, if not resumed
|
||||||
|
|
Loading…
Reference in New Issue