# androidx.core.content.res

*** ** * ** ***

## Classes

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/content/res/ConfigurationHelper` | Helper class which allows access to properties of `https://developer.android.com/reference/android/content/res/Configuration.html` in a backward compatible fashion. |
| `https://developer.android.com/reference/kotlin/androidx/core/content/res/ResourcesCompat` | Helper for accessing features in `https://developer.android.com/reference/android/content/res/Resources.html`. |
| `https://developer.android.com/reference/kotlin/androidx/core/content/res/ResourcesCompat.FontCallback` | Interface used to receive asynchronous font fetching events. |
| `https://developer.android.com/reference/kotlin/androidx/core/content/res/ResourcesCompat.ThemeCompat` | Provides backward-compatible implementations for new `https://developer.android.com/reference/android/content/res/Resources.Theme.html` APIs. |

## Extension functions summary

|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/android/content/res/TypedArray.html.https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getBooleanOrThrow(kotlin.Int)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/StyleableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Retrieve the boolean value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getBooleanOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/content/res/TypedArray.html.https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getColorOrThrow(kotlin.Int)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/StyleableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Retrieve the color value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getColorOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined. |
| `https://developer.android.com/reference/android/content/res/ColorStateList.html` | `https://developer.android.com/reference/android/content/res/TypedArray.html.https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getColorStateListOrThrow(kotlin.Int)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/StyleableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Retrieve the color state list value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getColorStateListOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/android/content/res/TypedArray.html.https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getDimensionOrThrow(kotlin.Int)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/StyleableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Retrieve the dimension value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getDimensionOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/Dimension https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/content/res/TypedArray.html.https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getDimensionPixelOffsetOrThrow(kotlin.Int)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/StyleableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Retrieve the dimension pixel offset value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getDimensionPixelOffsetOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/Dimension https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/content/res/TypedArray.html.https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getDimensionPixelSizeOrThrow(kotlin.Int)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/StyleableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Retrieve the dimension pixel size value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getDimensionPixelSizeOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined. |
| `https://developer.android.com/reference/android/graphics/drawable/Drawable.html` | `https://developer.android.com/reference/android/content/res/TypedArray.html.https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getDrawableOrThrow(kotlin.Int)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/StyleableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Retrieve the drawable value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getDrawableOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/android/content/res/TypedArray.html.https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getFloatOrThrow(kotlin.Int)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/StyleableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Retrieve the float value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getFloatOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined. |
| `https://developer.android.com/reference/android/graphics/Typeface.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 26) https://developer.android.com/reference/android/content/res/TypedArray.html.https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getFontOrThrow(kotlin.Int)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/StyleableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Retrieve the font value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getFontOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/content/res/TypedArray.html.https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getIntOrThrow(kotlin.Int)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/StyleableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Retrieve the integer value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getIntOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/content/res/TypedArray.html.https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getIntegerOrThrow(kotlin.Int)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/StyleableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Retrieve the integer value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getIntegerOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/AnyRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/content/res/TypedArray.html.https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getResourceIdOrThrow(kotlin.Int)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/StyleableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Retrieves the resource identifier for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getResourceIdOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/android/content/res/TypedArray.html.https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getStringOrThrow(kotlin.Int)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/StyleableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Retrieve the string value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getStringOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html>` | `https://developer.android.com/reference/android/content/res/TypedArray.html.https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getTextArrayOrThrow(kotlin.Int)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/StyleableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Retrieve the text array value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getTextArrayOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` | `https://developer.android.com/reference/android/content/res/TypedArray.html.https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getTextOrThrow(kotlin.Int)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/StyleableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Retrieve the text value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getTextOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined. |
| `inline R` | `<R : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/android/content/res/TypedArray.html.https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).use(kotlin.Function1)(block: (https://developer.android.com/reference/android/content/res/TypedArray.html) -> R)` Executes the given `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).use(kotlin.Function1)` function on this TypedArray and then recycles it. |

## Extension functions

### TypedArray.getBooleanOrThrow

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/content/res/TypedArray.kt+function:getBooleanOrThrow) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun TypedArray.getBooleanOrThrow(index: @StyleableRes Int): Boolean
```

Retrieve the boolean value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getBooleanOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray.html#hasValue(int)` |   |
| `https://developer.android.com/reference/android/content/res/TypedArray.html#getBoolean(int, boolean)` |   |

### TypedArray.getColorOrThrow

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/content/res/TypedArray.kt+function:getColorOrThrow) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun TypedArray.getColorOrThrow(index: @StyleableRes Int): @ColorInt Int
```

Retrieve the color value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getColorOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray.html#hasValue(int)` |   |
| `https://developer.android.com/reference/android/content/res/TypedArray.html#getColor(int, int)` |   |

### TypedArray.getColorStateListOrThrow

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/content/res/TypedArray.kt+function:getColorStateListOrThrow) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun TypedArray.getColorStateListOrThrow(index: @StyleableRes Int): ColorStateList
```

Retrieve the color state list value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getColorStateListOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray.html#hasValue(int)` |   |
| `https://developer.android.com/reference/android/content/res/TypedArray.html#getColorStateList(int)` |   |

### TypedArray.getDimensionOrThrow

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/content/res/TypedArray.kt+function:getDimensionOrThrow) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun TypedArray.getDimensionOrThrow(index: @StyleableRes Int): Float
```

Retrieve the dimension value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getDimensionOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray.html#hasValue(int)` |   |
| `https://developer.android.com/reference/android/content/res/TypedArray.html#getDimension(int, float)` |   |

### TypedArray.getDimensionPixelOffsetOrThrow

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/content/res/TypedArray.kt+function:getDimensionPixelOffsetOrThrow) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun TypedArray.getDimensionPixelOffsetOrThrow(index: @StyleableRes Int): @Dimension Int
```

Retrieve the dimension pixel offset value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getDimensionPixelOffsetOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray.html#hasValue(int)` |   |
| `https://developer.android.com/reference/android/content/res/TypedArray.html#getDimensionPixelOffset(int, int)` |   |

### TypedArray.getDimensionPixelSizeOrThrow

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/content/res/TypedArray.kt+function:getDimensionPixelSizeOrThrow) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun TypedArray.getDimensionPixelSizeOrThrow(index: @StyleableRes Int): @Dimension Int
```

Retrieve the dimension pixel size value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getDimensionPixelSizeOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray.html#hasValue(int)` |   |
| `https://developer.android.com/reference/android/content/res/TypedArray.html#getDimensionPixelSize(int, int)` |   |

### TypedArray.getDrawableOrThrow

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/content/res/TypedArray.kt+function:getDrawableOrThrow) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun TypedArray.getDrawableOrThrow(index: @StyleableRes Int): Drawable
```

Retrieve the drawable value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getDrawableOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray.html#hasValue(int)` |   |
| `https://developer.android.com/reference/android/content/res/TypedArray.html#getDrawable(int)` |   |

### TypedArray.getFloatOrThrow

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/content/res/TypedArray.kt+function:getFloatOrThrow) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun TypedArray.getFloatOrThrow(index: @StyleableRes Int): Float
```

Retrieve the float value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getFloatOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray.html#hasValue(int)` |   |
| `https://developer.android.com/reference/android/content/res/TypedArray.html#getFloat(int, float)` |   |

### TypedArray.getFontOrThrow

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/content/res/TypedArray.kt+function:getFontOrThrow) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
@RequiresApi(value = 26)
fun TypedArray.getFontOrThrow(index: @StyleableRes Int): Typeface
```

Retrieve the font value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getFontOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray.html#hasValue(int)` |   |
| `https://developer.android.com/reference/android/content/res/TypedArray.html#getFont(int)` |   |

### TypedArray.getIntOrThrow

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/content/res/TypedArray.kt+function:getIntOrThrow) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun TypedArray.getIntOrThrow(index: @StyleableRes Int): Int
```

Retrieve the integer value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getIntOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray.html#hasValue(int)` |   |
| `https://developer.android.com/reference/android/content/res/TypedArray.html#getInt(int, int)` |   |

### TypedArray.getIntegerOrThrow

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/content/res/TypedArray.kt+function:getIntegerOrThrow) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun TypedArray.getIntegerOrThrow(index: @StyleableRes Int): Int
```

Retrieve the integer value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getIntegerOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray.html#hasValue(int)` |   |
| `https://developer.android.com/reference/android/content/res/TypedArray.html#getInteger(int, int)` |   |

### TypedArray.getResourceIdOrThrow

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/content/res/TypedArray.kt+function:getResourceIdOrThrow) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun TypedArray.getResourceIdOrThrow(index: @StyleableRes Int): @AnyRes Int
```

Retrieves the resource identifier for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getResourceIdOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray.html#hasValue(int)` |   |
| `https://developer.android.com/reference/android/content/res/TypedArray.html#getResourceId(int, int)` |   |

### TypedArray.getStringOrThrow

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/content/res/TypedArray.kt+function:getStringOrThrow) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun TypedArray.getStringOrThrow(index: @StyleableRes Int): String
```

Retrieve the string value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getStringOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray.html#hasValue(int)` |   |
| `https://developer.android.com/reference/android/content/res/TypedArray.html#getString(int)` |   |

### TypedArray.getTextArrayOrThrow

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/content/res/TypedArray.kt+function:getTextArrayOrThrow) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun TypedArray.getTextArrayOrThrow(index: @StyleableRes Int): Array<CharSequence>
```

Retrieve the text array value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getTextArrayOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray.html#hasValue(int)` |   |
| `https://developer.android.com/reference/android/content/res/TypedArray.html#getTextArray(int)` |   |

### TypedArray.getTextOrThrow

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/content/res/TypedArray.kt+function:getTextOrThrow) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun TypedArray.getTextOrThrow(index: @StyleableRes Int): CharSequence
```

Retrieve the text value for the attribute at `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).getTextOrThrow(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if not defined.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray.html#hasValue(int)` |   |
| `https://developer.android.com/reference/android/content/res/TypedArray.html#getText(int)` |   |

### TypedArray.use

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/content/res/TypedArray.kt+function:use) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
inline fun <R : Any?> TypedArray.use(block: (TypedArray) -> R): R
```

Executes the given `https://developer.android.com/reference/kotlin/androidx/core/content/res/package-summary#(android.content.res.TypedArray).use(kotlin.Function1)` function on this TypedArray and then recycles it.

| See also |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.io/index.html` |   |