TypedArray.GetInteger(Int32, Int32) Method

Definition

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

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

Parameters

index
Int32

Index of attribute to retrieve.

defValue
Int32

Value to return if the attribute is not defined or not a resource.

Returns

Attribute integer value, or defValue if not defined.

Attributes

Exceptions

if the TypedArray has already been recycled.

if the attribute is defined but is not an integer.

Remarks

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

Unlike #getInt(int, int), this method will throw an exception if the attribute is defined but is not an integer.

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