I am having three files in xml folder
beginning_text.xml
preferences.xml
caller.xml
All three files are used as SharedPreferences file
Can i use all three files as
PreferenceManager.setDefaultValues(this, R.xml.sms_beginning_text, false);
addPreferencesFromResource(R.xml.sms_beginning_text);
PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
addPreferencesFromResource(R.xml.preferences);
PreferenceManager.setDefaultValues(this, R.xml.caller, false);
addPreferencesFromResource(R.xml.caller);
and then reading it like:
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
or how can i read and save 3 different files?
Declare the names of your preference files and while retriving the preferences, mention the name of that file which you want to access in getSharedPreferences().
Here I declare two file names : PrefFile and PrefFileNEW; then I pass the respective names to the getSharedPreference() while retrieving the preferences.
Hope it helps.