From e3c456fd95da5c149dd8e629b67583beb65fe00a Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 1 Apr 2021 17:35:45 +0300 Subject: [PATCH] Fix #10978 --- .../src/net/osmand/plus/settings/backend/OsmandSettings.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java index 39f3cf3d92..f227cb9b1e 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java @@ -853,7 +853,7 @@ public class OsmandSettings { public boolean setValue(Object prefs, DrivingRegion val) { boolean overrideMetricSystem = !DRIVING_REGION_AUTOMATIC.getValue(prefs, DRIVING_REGION_AUTOMATIC.getDefaultValue()); if (overrideMetricSystem && val != null) { - METRIC_SYSTEM.set(val.defMetrics); + METRIC_SYSTEM.setValue(prefs, val.defMetrics); } return super.setValue(prefs, val); } @@ -866,7 +866,7 @@ public class OsmandSettings { // this value string is synchronized with settings_pref.xml preference name // cache of metrics constants as they are used very often - public final OsmandPreference METRIC_SYSTEM = new EnumStringPreference(this, + public final EnumStringPreference METRIC_SYSTEM = (EnumStringPreference) new EnumStringPreference(this, "default_metric_system", MetricsConstants.KILOMETERS_AND_METERS, MetricsConstants.values()) { protected MetricsConstants getDefaultValue() { return DRIVING_REGION.get().defMetrics;