diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 0ee65645d4..dfdf86297c 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -110,13 +110,12 @@ public class OsmandSettings { protected OsmandSettings(OsmandApplication clientContext, SettingsAPI settinsAPI) { ctx = clientContext; this.settingsAPI = settinsAPI; + initPrefs(); + } + private void initPrefs() { globalPreferences = settingsAPI.getPreferenceObject(SHARED_PREFERENCES_NAME); - // start from default settings - currentMode = ApplicationMode.DEFAULT; - defaultProfilePreferences = getProfilePreferences(ApplicationMode.DEFAULT); - profilePreferences = defaultProfilePreferences; currentMode = readApplicationMode(); profilePreferences = getProfilePreferences(currentMode); } @@ -127,6 +126,7 @@ public class OsmandSettings { public void setSettingsAPI(SettingsAPI settingsAPI) { this.settingsAPI = settingsAPI; + initPrefs(); } public SettingsAPI getSettingsAPI() { diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyCustomization.java b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyCustomization.java index 35ef935ed6..3c467133bf 100644 --- a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyCustomization.java +++ b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyCustomization.java @@ -113,6 +113,9 @@ public class SherpafyCustomization extends OsmAndAppCustomization { } } } + if (selectedName == null) { + app.getSettings().setSettingsAPI(originalSettings.getSettingsAPI()); + } } } this.tourPresent = tourPresent;