Share via


IPreferenceDataStore.GetBoolean(String, Boolean) Method

Definition

Retrieve a boolean value from the data store.

[Android.Runtime.Register("getBoolean", "(Ljava/lang/String;Z)Z", "GetGetBoolean_Ljava_lang_String_ZHandler:Android.Preferences.IPreferenceDataStore, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public virtual bool GetBoolean (string? key, bool defValue);
[<Android.Runtime.Register("getBoolean", "(Ljava/lang/String;Z)Z", "GetGetBoolean_Ljava_lang_String_ZHandler:Android.Preferences.IPreferenceDataStore, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member GetBoolean : string * bool -> bool
override this.GetBoolean : string * bool -> bool

Parameters

key
String

The name of the preference to retrieve.

defValue
Boolean

Value to return if this preference does not exist.

Returns

Attributes

Remarks

Retrieve a boolean value from the data store.

Java documentation for android.preference.PreferenceDataStore.getBoolean(java.lang.String, boolean).

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