Aracılığıyla paylaş


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

Operating mode. Use #MODE_PRIVATE for the default operation.

Returns

Returns the single SharedPreferences instance that can be used to retrieve and modify the preference values.

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.

Java documentation for android.app.Activity.getPreferences(int).

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