diff --git a/OsmAnd/src/net/osmand/plus/activities/FavouritesActivity.java b/OsmAnd/src/net/osmand/plus/activities/FavouritesActivity.java index f90278c9f7..4e2196b392 100644 --- a/OsmAnd/src/net/osmand/plus/activities/FavouritesActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/FavouritesActivity.java @@ -613,9 +613,12 @@ public class FavouritesActivity extends OsmandExpandableListActivity { ch.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - if(ch.isChecked()){ + if (ch.isChecked()) { groupsToDelete.add(model); - favoritesToDelete.addAll(helper.getFavoriteGroups().get(model)); + List fvs = helper.getFavoriteGroups().get(model); + if (fvs != null) { + favoritesToDelete.addAll(fvs); + } favouritesAdapter.notifyDataSetInvalidated(); } else { groupsToDelete.remove(model); diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 8f310e69c6..5feb0b05b1 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -352,15 +352,16 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe builder.setPositiveButton(R.string.default_buttons_yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - restoreRoutingMode(); + quit = true; + restoreRoutingModeInner(); } }); builder.setNegativeButton(R.string.default_buttons_no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - notRestoreRoutingMode(); quit = true; + notRestoreRoutingMode(); } }); final AlertDialog dlg = builder.show(); @@ -383,8 +384,11 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe delay --; tv.setText(getString(R.string.continue_follow_previous_route_auto, delay + "")); if(delay <= 0) { - dlg.dismiss(); - restoreRoutingMode(); + if(dlg.isShowing()) { + dlg.dismiss(); + } + quit = true; + restoreRoutingModeInner(); } else { uiHandler.postDelayed(delayDisplay, 1000); } @@ -394,8 +398,7 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe delayDisplay.run(); } - private void restoreRoutingMode() { - quit = true; + private void restoreRoutingModeInner() { AsyncTask task = new AsyncTask() { @Override protected GPXFile doInBackground(String... params) { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index 088a60c8b9..d9e4217df2 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -45,6 +45,9 @@ public class OsmEditingPlugin extends OsmandPlugin { @Override public void updateLayers(OsmandMapTileView mapView, MapActivity activity){ + if (osmBugsLayer == null) { + registerLayers(activity); + } if(mapView.getLayers().contains(osmBugsLayer) != settings.SHOW_OSM_BUGS.get()){ if(settings.SHOW_OSM_BUGS.get()){ mapView.addLayer(osmBugsLayer, 2);