Merge changes.

This commit is contained in:
Sandor Dornbush
2010-09-23 14:30:44 -07:00
parent 21b0a517a9
commit 35182a1483
2 changed files with 4 additions and 18 deletions
@@ -1020,6 +1020,7 @@ public class MyTracksMap extends MapActivity
long lastStoredLocationId =
providerUtils.getLastLocationId(selectedTrackId);
int samplingFrequency = -1;
Location location = new Location("");
for (;;) {
Cursor cursor = null;
try {
@@ -1047,7 +1048,7 @@ public class MyTracksMap extends MapActivity
numTotalPoints / MyTracksConstants.TARGET_DISPLAYED_TRACK_POINTS);
}
Location location = providerUtils.createLocation(cursor);
providerUtils.fillLocation(cursor, location);
// Include a point if it fits one of the following criteria:
// - Has the mod for the sampling frequency (includes first point).
@@ -1056,7 +1057,8 @@ public class MyTracksMap extends MapActivity
if (numPoints % samplingFrequency == 0 ||
(!isRecordingSelected() && locationId == lastStoredLocationId) ||
!MyTracksUtils.isValidLocation(location)) {
mapOverlay.addLocation(location);
// Only allocate a new location if it is going to be kept around.
mapOverlay.addLocation(new Location(location));
}
numPoints++;