This commit is contained in:
Alexey Kulish 2017-03-30 10:10:38 +03:00
parent 82e5ee817d
commit 8fcf52697f

View file

@ -422,9 +422,10 @@ public class SavingTrackHelper extends SQLiteOpenHelper {
if (points.size() == 0 || newSegment) { if (points.size() == 0 || newSegment) {
points.add(new TrkSegment()); points.add(new TrkSegment());
} }
boolean segmentAdded = false;
if (track.segments.size() == 0 || newSegment) { if (track.segments.size() == 0 || newSegment) {
track.segments.add(new TrkSegment()); track.segments.add(new TrkSegment());
currentTrack.processPoints(); segmentAdded = true;
} }
if (pt != null) { if (pt != null) {
int ind = points.size() - 1; int ind = points.size() - 1;
@ -433,6 +434,9 @@ public class SavingTrackHelper extends SQLiteOpenHelper {
TrkSegment lt = track.segments.get(track.segments.size() - 1); TrkSegment lt = track.segments.get(track.segments.size() - 1);
lt.points.add(pt); lt.points.add(pt);
} }
if (segmentAdded) {
currentTrack.processPoints();
}
currentTrack.getModifiableGpxFile().modifiedTime = time; currentTrack.getModifiableGpxFile().modifiedTime = time;
} }