From e01a98fa13876b3f86b1b9e4e1eb8047c7d21966 Mon Sep 17 00:00:00 2001 From: Zahnstocher Date: Sun, 9 Nov 2014 03:41:08 +0100 Subject: [PATCH] fix route recalculation and screen update issue on MapActivity resume --- OsmAnd/src/net/osmand/plus/TargetPointsHelper.java | 10 +++++++++- OsmAnd/src/net/osmand/plus/activities/MapActivity.java | 8 +++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java b/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java index 4695406e8f..2be0be1dfb 100644 --- a/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java +++ b/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java @@ -124,7 +124,15 @@ public class TargetPointsHelper { return intermediatePoints; } - + public List getIntermediatePointsLatLon() { + List intermediatePointsLatLon = new ArrayList(); + + for (TargetPoint t : intermediatePoints) { + intermediatePointsLatLon.add(t.point); + } + + return intermediatePointsLatLon; + } public List getIntermediatePointsWithTarget() { List res = new ArrayList(); diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 406a47e1b8..2b8184403d 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -312,9 +312,7 @@ public class MapActivity extends AccessibleActivity implements @Override protected void onResume() { super.onResume(); - if (wakeLock != null) { - return; - } + cancelNotification(); //fixing bug with action bar appearing on android 2.3.3 if (getSupportActionBar() != null){ @@ -356,8 +354,8 @@ public class MapActivity extends AccessibleActivity implements TargetPointsHelper targets = app.getTargetPointsHelper(); RoutingHelper routingHelper = app.getRoutingHelper(); if (routingHelper.isFollowingMode() && ( - !Algorithms.objectEquals(targets.getPointToNavigate(), routingHelper.getFinalLocation() )|| - !Algorithms.objectEquals(targets.getIntermediatePoints(), routingHelper.getIntermediatePoints()) + !Algorithms.objectEquals(targets.getPointToNavigate().point, routingHelper.getFinalLocation() )|| + !Algorithms.objectEquals(targets.getIntermediatePointsLatLon(), routingHelper.getIntermediatePoints()) )) { targets.updateRouteAndReferesh(true); }