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