Can Android Preferences/settings Screen Be Configured To Use Preferences Other Than 'default' Shared Preferences?
Android Tutorials and examples show how to use Preference Fragment and Preference Activity to create Settings screen in an app. However, all preferences exposed this way get their
Solution 1:
Technically these three lines will get the job done from one side. And now that it sets the Preference for all the activities, the simple way to overcome that is it initialize default SharedPreferences where needed and Custom SharedPreferences where are wanted.
getPreferenceManager().setSharedPreferencesName("custom_prefs");
getPreferenceManager().setSharedPreferencesMode(MODE_PRIVATE);
addPreferencesFromResource(R.xml.prefs);
Post a Comment for "Can Android Preferences/settings Screen Be Configured To Use Preferences Other Than 'default' Shared Preferences?"