Activity.GetPreferences(FileCreationMode) Method

Definition

Retrieve a SharedPreferences object for accessing preferences that are private to this activity.

[Android.Runtime.Register("getPreferences", "(I)Landroid/content/SharedPreferences;", "GetGetPreferences_IHandler")]
public virtual Android.Content.ISharedPreferences? GetPreferences(Android.Content.FileCreationMode mode);
[<Android.Runtime.Register("getPreferences", "(I)Landroid/content/SharedPreferences;", "GetGetPreferences_IHandler")>]
abstract member GetPreferences : Android.Content.FileCreationMode -> Android.Content.ISharedPreferences
override this.GetPreferences : Android.Content.FileCreationMode -> Android.Content.ISharedPreferences

Parameters

mode
FileCreationMode

int: Operating mode. Use Context.MODE_PRIVATE for the default operation. Value is either 0 or a combination of the following: Context.MODE_PRIVATE Context.MODE_WORLD_READABLE Context.MODE_WORLD_WRITEABLE Context.MODE_MULTI_PROCESS

Returns

Attributes

Remarks

Retrieve a SharedPreferences object for accessing preferences that are private to this activity. This simply calls the underlying getSharedPreferences(String,int) method by passing in this activity's class name as the preferences name.

Android reference for android.app.Activity.getPreferences.

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