From 33fb24c5e5c639c936d6625aad79e3b880cf5256 Mon Sep 17 00:00:00 2001 From: Jimmy Shih Date: Wed, 20 Nov 2013 10:58:44 -0800 Subject: [PATCH] Bug fix, only update calorie in statistics markers --- .../com/google/android/apps/mytracks/util/CalorieUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MyTracks/src/com/google/android/apps/mytracks/util/CalorieUtils.java b/MyTracks/src/com/google/android/apps/mytracks/util/CalorieUtils.java index 574bb26b7..1990845eb 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/util/CalorieUtils.java +++ b/MyTracks/src/com/google/android/apps/mytracks/util/CalorieUtils.java @@ -233,10 +233,11 @@ public class CalorieUtils { * Yes, this will skip the first waypoint and that is intentional as the * first waypoint holds the stats for the track. */ - while (cursor.moveToNext()) { - Waypoint waypoint = myTracksProviderUtils.createWaypoint(cursor); + Waypoint waypoint = getNextStatisticsWaypoint(myTracksProviderUtils, cursor); + while (waypoint != null) { waypoint.getTripStatistics().setCalorie(0); myTracksProviderUtils.updateWaypoint(waypoint); + waypoint = getNextStatisticsWaypoint(myTracksProviderUtils, cursor); } } } finally {