Rotary Heart
Rotary Heart

Reputation: 1969

Shared prefs, how can I create one with a name fileNames?

I have read that you can create more that one shared pref file, but I don't know how. This is how I normally use shared prefs.

SharedPreferences get;
SharedPreferences.Editor save;

get = PreferenceManager.getDefaultSharedPreferences(context);
save = PreferenceManager.getDefaultSharedPreferences(context).edit();

This makes the file named package.name_preferences.xml. So how can I create the file package.name_fileNames.xml and how I write and read from it?

Upvotes: 0

Views: 88

Answers (1)

Gabe Sechan
Gabe Sechan

Reputation: 93561

Use getSharedPreferences(String name, int mode) on the activity instead of using the preference manager.

Upvotes: 1

Related Questions