diff --git a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java index d0d0acb1a4..3a15cb8ef1 100644 --- a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java @@ -252,6 +252,14 @@ public class MapMarkersHelper { } } + public void removeMarkerFromHistory(MapMarker marker) { + if (marker != null) { + markersDbHelper.removeMarkerFromHistory(marker); + loadMarkers(); + refresh(); + } + } + public List getMapMarkers() { return mapMarkers; } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java index f2c8b76d1b..3ad7f41f8f 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java @@ -82,7 +82,11 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel @Override public void onDeleteMarker(int pos) { - + Object item = adapter.getItem(pos); + if (item instanceof MapMarker) { + app.getMapMarkersHelper().removeMarkerFromHistory((MapMarker) item); + adapter.notifyItemRemoved(pos); + } } }; }