useObtainedStyledAttributesByAttr

fun <R> Context.useObtainedStyledAttributesByAttr(@AttrRes attrRes: Int, attrs: IntArray, useBlock: (TypedArray) -> R): R

Obtains a TypedArray holding the values defined by attrRes which are listed in attrs and calls the useBlock with this array. Note: The obtained TypedArray is automatically recycled.

Throws

if the given attribute cannot be found.