Udostępnij za pośrednictwem


ContextWrapper.GetSharedPreferences(String, FileCreationMode) Method

Definition

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 override Android.Content.ISharedPreferences? GetSharedPreferences (string? name, Android.Content.FileCreationMode mode);
[<Android.Runtime.Register("getSharedPreferences", "(Ljava/lang/String;I)Landroid/content/SharedPreferences;", "GetGetSharedPreferences_Ljava_lang_String_IHandler")>]
override this.GetSharedPreferences : string * Android.Content.FileCreationMode -> Android.Content.ISharedPreferences

Parameters

name
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()).

mode
FileCreationMode

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

Returns

Attributes

Remarks

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