// TODO make all layers profile preferenced???? private OsmandSettings(OsmandApplication ctx) { this.ctx = ctx; globalPreferences = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE); // start from default settings currentMode = ApplicationMode.DEFAULT; defaultProfilePreferences = getProfilePreferences(ApplicationMode.DEFAULT); profilePreferences = defaultProfilePreferences; // if(FOLLOW_TO_THE_ROUTE.get()){ currentMode = readApplicationMode(); profilePreferences = getProfilePreferences(currentMode); // } }
private SharedPreferences getProfilePreferences(ApplicationMode mode) { return ctx.getSharedPreferences(getSharedPreferencesName(mode), Context.MODE_WORLD_READABLE); }