Context.GetSharedPreferences(String, FileCreationMode) Context.GetSharedPreferences(String, FileCreationMode) Method


Retrieve and hold the contents of the preferences file 'name', returning a SharedPreferences through which you can retrieve and modify its values.

[Android.Runtime.Register("getSharedPreferences", "(Ljava/lang/String;I)Landroid/content/SharedPreferences;", "GetGetSharedPreferences_Ljava_lang_String_IHandler")]
public abstract Android.Content.ISharedPreferences GetSharedPreferences (string name, Android.Content.FileCreationMode mode);
abstract member GetSharedPreferences : string * Android.Content.FileCreationMode -> Android.Content.ISharedPreferences


String String

Desired preferences file. If a preferences file by this name does not exist, it will be created when you retrieve an editor (SharedPreferences.edit()) and then commit changes (Editor.commit()).

FileCreationMode FileCreationMode

Operating mode. Use 0 or Private for the default operation, WorldReadable and WorldWriteable to control permissions.



Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to