From 2e2f266b1c27344c3a0014931b9d0ac75200efaa Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Jun 2014 09:20:08 +0300 Subject: [PATCH 1/2] fixed issues with app crush. renamed wrong named method. Fixed isse with NavigateToNext --- .../plus/routepointsnavigation/RoutePointsActivity.java | 7 +++++-- .../plus/routepointsnavigation/RoutePointsPlugin.java | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsActivity.java b/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsActivity.java index 101502adad..d9e5458b77 100644 --- a/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsActivity.java +++ b/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsActivity.java @@ -3,6 +3,7 @@ package net.osmand.plus.routepointsnavigation; import java.util.ArrayList; import java.util.List; +import android.content.Intent; import net.osmand.CallbackWithObject; import net.osmand.data.LatLon; import net.osmand.plus.GPXUtilities; @@ -80,7 +81,7 @@ public class RoutePointsActivity extends OsmandListActivity { SelectedRouteGpxFile sgpx = plugin.getCurrentRoute(); if (!sgpx.getCurrentPoints().isEmpty() && !sgpx.getCurrentPoints().get(0).isNextNavigate){ - sgpx.naviateToNextPoint(); + sgpx.navigateToNextPoint(); } prepareView(); return false; @@ -286,7 +287,9 @@ public class RoutePointsActivity extends OsmandListActivity { return true; } else if (item.getItemId() == NAVIGATE_DIALOG_ID){ app.getSettings().navigateDialog(); - MapActivity.launchMapActivityMoveToTop(getMyApplication()); + Intent intent = new Intent(this, app.getAppCustomization().getMapActivity()); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); return true; } return super.onOptionsItemSelected(item); diff --git a/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsPlugin.java b/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsPlugin.java index f8c74979ba..3d8cd60d6a 100644 --- a/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsPlugin.java +++ b/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsPlugin.java @@ -67,7 +67,7 @@ public class RoutePointsPlugin extends OsmandPlugin { @Override public boolean destinationReached() { if (currentRoute != null) { - boolean naviateToNextPoint = currentRoute.naviateToNextPoint(); + boolean naviateToNextPoint = currentRoute.navigateToNextPoint(); if (naviateToNextPoint) { return false; @@ -261,7 +261,7 @@ public class RoutePointsPlugin extends OsmandPlugin { public void markPoint(RoutePoint point, boolean visited) { if (point.isNextNavigate() && visited) { - naviateToNextPoint(); + navigateToNextPoint(); return; } if (visited) { @@ -272,11 +272,12 @@ public class RoutePointsPlugin extends OsmandPlugin { sortPoints(); } - public boolean naviateToNextPoint() { + public boolean navigateToNextPoint() { if (!currentPoints.isEmpty()) { RoutePoint rp = currentPoints.get(0); if (rp.isNextNavigate) { rp.setVisitedTime(System.currentTimeMillis()); + rp.isNextNavigate = false; sortPoints(); } RoutePoint first = currentPoints.get(0); From 820e56879372b25801dea00601a2edd43344d459 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Jun 2014 09:20:58 +0300 Subject: [PATCH 2/2] renamed method. --- .../net/osmand/plus/routepointsnavigation/RoutePointsLayer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsLayer.java b/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsLayer.java index 608bf6b9ac..7df13be7e8 100644 --- a/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsLayer.java +++ b/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsLayer.java @@ -87,7 +87,7 @@ public class RoutePointsLayer extends OsmandMapLayer implements ContextMenuLaye plugin.getCurrentRoute().navigateToPoint(point); plugin.saveGPXAsync(); } else if (itemId == R.string.navigate_to_next){ - plugin.getCurrentRoute().naviateToNextPoint(); + plugin.getCurrentRoute().navigateToNextPoint(); plugin.saveGPXAsync(); } map.refreshMap();