Compartilhar via


Preference.ShouldPersist Method

Definition

Checks whether, at the given time this method is called, this Preference should store/restore its value(s) into the SharedPreferences or into PreferenceDataStore if assigned.

[Android.Runtime.Register("shouldPersist", "()Z", "GetShouldPersistHandler")]
protected virtual bool ShouldPersist ();
[<Android.Runtime.Register("shouldPersist", "()Z", "GetShouldPersistHandler")>]
abstract member ShouldPersist : unit -> bool
override this.ShouldPersist : unit -> bool

Returns

True if it should persist the value.

Attributes

Remarks

Checks whether, at the given time this method is called, this Preference should store/restore its value(s) into the SharedPreferences or into PreferenceDataStore if assigned. This, at minimum, checks whether this Preference is persistent and it currently has a key. Before you save/restore from the storage, check this first.

Java documentation for android.preference.Preference.shouldPersist().

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