From c97bde4bc130c52847dca50bc94d698a2ee8c2bb Mon Sep 17 00:00:00 2001 From: Bars107 Date: Wed, 24 Dec 2014 12:27:20 +0200 Subject: [PATCH] Fixed bug when not possible to select other custom filter in drawer in waypoints --- .../osmand/plus/helpers/WaypointDialogHelper.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java index fcb028834e..2906606c8d 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java @@ -484,7 +484,17 @@ public class WaypointDialogHelper implements OsmAndLocationListener { if (type == WaypointHelper.POI && btn.isChecked()){ running[0] = position; thisAdapter.notifyDataSetInvalidated(); - selectPoi(running, thisAdapter, type, true, ctx); + MapActivity map = (MapActivity) ctx; + final PoiFilter[] selected = new PoiFilter[1]; + AlertDialog dlg = map.getMapLayers().selectPOIFilterLayer(map.getMapView(), selected); + dlg.setOnDismissListener(new OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialog) { + if (selected != null) { + enableType(running, thisAdapter, type, true); + } + } + }); } } }); @@ -493,7 +503,8 @@ public class WaypointDialogHelper implements OsmAndLocationListener { private void selectPoi(final int[] running, final ArrayAdapter listAdapter, final int type, final boolean enable, Activity ctx) { - if (ctx instanceof MapActivity && !PoiFilter.CUSTOM_FILTER_ID.equals(app.getSettings().getPoiFilterForMap())) { + if (ctx instanceof MapActivity && + !PoiFilter.CUSTOM_FILTER_ID.equals(app.getSettings().getPoiFilterForMap())) { MapActivity map = (MapActivity) ctx; final PoiFilter[] selected = new PoiFilter[1]; AlertDialog dlg = map.getMapLayers().selectPOIFilterLayer(map.getMapView(), selected);