Udostępnij za pośrednictwem


TypedArray.GetInt(Int32, Int32) Method

Definition

Retrieve the integer value for the attribute at <var>index</var>.

[Android.Runtime.Register("getInt", "(II)I", "GetGetInt_IIHandler")]
public virtual int GetInt (int index, int defValue);
[<Android.Runtime.Register("getInt", "(II)I", "GetGetInt_IIHandler")>]
abstract member GetInt : int * int -> int
override this.GetInt : int * int -> int

Parameters

index
Int32

Index of attribute to retrieve.

defValue
Int32

Value to return if the attribute is not defined or cannot be coerced to an integer.

Returns

Integer value of the attribute, or defValue if the attribute was not defined or could not be coerced to an integer.

Attributes

Exceptions

if the TypedArray has already been recycled.

Remarks

Retrieve the integer value for the attribute at <var>index</var>.

If the attribute is not an integer, this method will attempt to coerce it to an integer using Integer#decode(String).

Java documentation for android.content.res.TypedArray.getInt(int, 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