Język

IPreferenceDataStore.GetInt(String, Int32) Method

Definition

Retrieve an int value from the data store.

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

Parameters

key
String

The name of the preference to retrieve.

defValue
Int32

Value to return if this preference does not exist.

Returns

The value for key, or defValue if no value is available. The default implementation returns defValue without reading storage.

Attributes

Remarks

Retrieve an int value from the data store.

Java documentation for android.preference.PreferenceDataStore.getInt(java.lang.String, 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