fixed issues with app crush. renamed wrong named method. Fixed isse with NavigateToNext

This commit is contained in:
unknown 2014-06-23 09:20:08 +03:00
parent aa358de67c
commit 2e2f266b1c
2 changed files with 9 additions and 5 deletions

View file

@ -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);

View file

@ -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);