Udostępnij za pośrednictwem


TypedArray.GetResourceId(Int32, Int32) Method

Definition

Retrieves the resource identifier for the attribute at <var>index</var>.

[Android.Runtime.Register("getResourceId", "(II)I", "GetGetResourceId_IIHandler")]
public virtual int GetResourceId (int index, int defValue);
[<Android.Runtime.Register("getResourceId", "(II)I", "GetGetResourceId_IIHandler")>]
abstract member GetResourceId : int * int -> int
override this.GetResourceId : 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 resource identifier, or defValue if not defined.

Attributes

Exceptions

if the TypedArray has already been recycled.

Remarks

Retrieves the resource identifier for the attribute at <var>index</var>. Note that attribute resource as resolved when the overall TypedArray object is retrieved. As a result, this function will return the resource identifier of the final resource value that was found, <em>not</em> necessarily the original resource that was specified by the attribute.

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