Freigeben über


IPreferenceDataStore.PutBoolean(String, Boolean) Method

Definition

Set a boolean value to the data store.

[Android.Runtime.Register("putBoolean", "(Ljava/lang/String;Z)V", "GetPutBoolean_Ljava_lang_String_ZHandler:Android.Preferences.IPreferenceDataStore, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public virtual void PutBoolean (string? key, bool value);
[<Android.Runtime.Register("putBoolean", "(Ljava/lang/String;Z)V", "GetPutBoolean_Ljava_lang_String_ZHandler:Android.Preferences.IPreferenceDataStore, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member PutBoolean : string * bool -> unit
override this.PutBoolean : string * bool -> unit

Parameters

key
String

The name of the preference to modify.

value
Boolean

The new value for the preference.

Attributes

Remarks

Set a boolean value to the data store.

Once the value is set the data store is responsible for holding it.

Java documentation for android.preference.PreferenceDataStore.putBoolean(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