Save previously selected application mode

This commit is contained in:
Victor Shcherb 2012-05-30 23:29:22 +02:00
parent ac7540ee2a
commit 8dbd53838f
2 changed files with 4 additions and 0 deletions

View file

@ -469,6 +469,9 @@ public class OsmandSettings {
} }
public final OsmandPreference<ApplicationMode> PREV_APPLICATION_MODE = new EnumIntPreference<ApplicationMode>(
"prev_application_mode", ApplicationMode.DEFAULT, true, false, ApplicationMode.values());
// this value string is synchronized with settings_pref.xml preference name // this value string is synchronized with settings_pref.xml preference name
// cache of metrics constants as they are used very often // cache of metrics constants as they are used very often
public final OsmandPreference<MetricsConstants> METRIC_SYSTEM = new EnumIntPreference<MetricsConstants>( public final OsmandPreference<MetricsConstants> METRIC_SYSTEM = new EnumIntPreference<MetricsConstants>(

View file

@ -471,6 +471,7 @@ public class MapActivityActions implements DialogProvider {
} }
ApplicationMode mode = getAppMode(buttons, settings); ApplicationMode mode = getAppMode(buttons, settings);
// change global settings // change global settings
settings.PREV_APPLICATION_MODE.set(settings.APPLICATION_MODE.get());
boolean changed = settings.APPLICATION_MODE.set(mode); boolean changed = settings.APPLICATION_MODE.set(mode);
if (changed) { if (changed) {
mapActivity.updateApplicationModeSettings(); mapActivity.updateApplicationModeSettings();