android - Can I save SharedPreferences to file so I can have multiple instances of the prefs? -


I love how SharePreferences works in Android and I would like to know if it's an easy to save in any other file The way I could load the previous example of prefaces and vice versa, in fact, when you load this file, this change in all the preferences is how I was done earlier in a similar way. 3 or 4 different characters of the key Issues I want to be able to swap. An easy way to do this?

Yes it is possible to have a method called getSharedPreferences (string name, int mode) in context

Retrieve and hold the contents of the file 'name' of the preferences, a shared option shared by which you can retrieve and modify its sharePreferences only one of the objects Installation has been returned to any caller for the same name, which means that as soon as they make it, and One see editing other.

  Parameter Name Expected Preferences File If no preference file is present in this name, then when you will receive an editor (shared references .it) and then make changes ( Editor.commit ()). To control mode operating mode permissions, use 0 or MODE_PRIVATE for the default operation, MODE_WORLD_READABLE and MODE_WORLD_WRITEABLE. Returns a shared sharing frequency that can be used to retrieve and modify preference values.  

Comments