From 5b1aff575d4bbe8e2ca0aa455b5d9a16f9b363e3 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Fri, 3 Jul 2015 12:30:37 +0300 Subject: [PATCH] Fix bug with reset --- OsmAnd/src/net/osmand/plus/OsmandSettings.java | 6 +++++- .../net/osmand/plus/activities/EditPOIFilterActivity.java | 1 + .../net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 217ec3634e..22d395776b 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -359,7 +359,11 @@ public class OsmandSettings { @Override public void resetToDefault(){ - set(getDefaultValue()); + T o = defaultValue; + if(defaultValues != null && defaultValues.containsKey(currentMode)){ + o = defaultValues.get(currentMode); + } + set(o); } @Override diff --git a/OsmAnd/src/net/osmand/plus/activities/EditPOIFilterActivity.java b/OsmAnd/src/net/osmand/plus/activities/EditPOIFilterActivity.java index ca473235c4..ebda3ca0fb 100644 --- a/OsmAnd/src/net/osmand/plus/activities/EditPOIFilterActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/EditPOIFilterActivity.java @@ -279,6 +279,7 @@ public class EditPOIFilterActivity extends OsmandListActivity { filter.setTypeToAccept(model, false); helper.editPoiFilter(filter); } + notifyDataSetChanged(); } }); } diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java index 3d57d4ef9d..553eefb7b6 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java @@ -246,7 +246,7 @@ public class MapWidgetRegistry { public boolean onContextMenuClick(ArrayAdapter a, int itemId, int pos, boolean isChecked) { pref.set(!pref.get()); map.updateApplicationModeSettings(); - a.notifyDataSetInvalidated(); + a.notifyDataSetChanged();; return false; } };