Declare the names of your preference files and, returning the preferences, specify the name of this file that you want to access in getSharedPreferences ().
Here I declare two file names: PrefFile and PrefFileNEW; then I pass the corresponding getSharedPreference () names when I get preferences.
public static final String PREF_FILE_NAME = "PrefFile"; public static final String PREF_FILE_NAME_NEW = "PrefFileNEW"; SharedPreferences preferences = getSharedPreferences(PREF_FILE_NAME, MODE_PRIVATE); {
Hope this helps.
source share