Answer the question
In order to leave comments, you need to log in
How to organize multiple versions of application settings?
The user can connect to different addresses of a particular service. It is necessary to load the settings when changing the connection. The list of settings is the same everywhere.
Regardless of prefName, the same settings are loaded:
// String prefName = "foo";
String prefName = "bar";
PreferenceManager.setDefaultValues(this, prefName, Context.MODE_PRIVATE,
R.xml.root_preferences, false);
Answer the question
In order to leave comments, you need to log in
for each connection address, you can create a
separate preference xml file using the SharedPreferences context
getSharedPreferences(String name, @PreferencesMode int mode);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question