ISharedPreferences.Contains(String) Method

Definition

Checks whether the preferences contains a preference.

[Android.Runtime.Register("contains", "(Ljava/lang/String;)Z", "GetContains_Ljava_lang_String_Handler:Android.Content.ISharedPreferencesInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool Contains (string? key);
[<Android.Runtime.Register("contains", "(Ljava/lang/String;)Z", "GetContains_Ljava_lang_String_Handler:Android.Content.ISharedPreferencesInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Contains : string -> bool

Parameters

key
String

The name of the preference to check.

Returns

Returns true if the preference exists in the preferences, otherwise false.

Attributes

Remarks

Checks whether the preferences contains a preference.

Java documentation for android.content.SharedPreferences.contains(java.lang.String).

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