Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/content/res/Resources#nestedclasses) \| [Constants](https://developer.android.com/reference/android/content/res/Resources#constants) \| [Ctors](https://developer.android.com/reference/android/content/res/Resources#pubctors) \| [Methods](https://developer.android.com/reference/android/content/res/Resources#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/content/res/Resources#inhmethods)

# Resources

*** ** * ** ***

` public class Resources `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.content.res.Resources |

Known direct subclasses [MockResources](https://developer.android.com/reference/android/test/mock/MockResources) [MockResources](https://developer.android.com/reference/android/test/mock/MockResources) *This class was deprecated in API level 24. Use a mocking framework like [Mockito](https://github.com/mockito/mockito). New tests should be written using the [Android Testing Support Library](https://developer.android.com/tools/testing-support-library).*   

*** ** * ** ***

Class for accessing an application's resources. This sits on top of the asset manager of the application (accessible through `https://developer.android.com/reference/android/content/res/Resources#getAssets()`) and provides a high-level API for getting typed data from the assets.

The Android resource system keeps track of all non-code assets associated with an application. You can use this class to access your application's resources. You can generally acquire the `https://developer.android.com/reference/android/content/res/Resources` instance associated with your application with `https://developer.android.com/reference/android/content/Context#getResources()`.

The Android SDK tools compile your application's resources into the application binary at build time. To use a resource, you must install it correctly in the source tree (inside your project's `res/` directory) and build your application. As part of the build process, the SDK tools generate symbols for each resource, which you can use in your application code to access the resources.

Using application resources makes it easy to update various characteristics of your application without modifying code, and---by providing sets of alternative resources---enables you to optimize your application for a variety of device configurations (such as for different languages and screen sizes). This is an important aspect of developing Android applications that are compatible on different types of devices.

After `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R`, `https://developer.android.com/reference/android/content/res/Resources` must be obtained by `https://developer.android.com/reference/android/app/Activity` or `https://developer.android.com/reference/android/content/Context` created with `https://developer.android.com/reference/android/content/Context#createWindowContext(int,%20android.os.Bundle)`. `https://developer.android.com/reference/android/content/ContextWrapper#getResources()` may report wrong values in multi-window or on secondary displays.

For more information about using resources, see the documentation about [Application Resources](https://developer.android.com/guide/topics/resources).

<br />

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` This exception is thrown by the resource APIs when a requested resource can not be found. |
| ` class` | `https://developer.android.com/reference/android/content/res/Resources.Theme` This class holds the current attribute values for a particular theme. |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/content/res/Resources#ID_NULL` The `null` resource ID. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/content/res/Resources#Resources(android.content.res.AssetManager,%20android.util.DisplayMetrics,%20android.content.res.Configuration)(https://developer.android.com/reference/android/content/res/AssetManager assets, https://developer.android.com/reference/android/util/DisplayMetrics metrics, https://developer.android.com/reference/android/content/res/Configuration config) ` *This constructor is deprecated. Resources should not be constructed by apps. See `https://developer.android.com/reference/android/content/Context#createConfigurationContext(android.content.res.Configuration)`.* |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/content/res/Resources#addLoaders(android.content.res.loader.ResourcesLoader[])(https://developer.android.com/reference/android/content/res/loader/ResourcesLoader loaders) ` Adds a loader to the list of loaders. |
| ` final void` | ` https://developer.android.com/reference/android/content/res/Resources#finishPreloading()() ` Called by zygote when it is done preloading resources, to change back to normal Resources operation. |
| ` final void` | ` https://developer.android.com/reference/android/content/res/Resources#flushLayoutCache()() ` Call this to remove all cached loaded layout resources from the Resources object. |
| ` https://developer.android.com/reference/android/content/res/XmlResourceParser` | ` https://developer.android.com/reference/android/content/res/Resources#getAnimation(int)(int id) ` Return an XmlResourceParser through which you can read an animation description for the given resource ID. |
| ` final https://developer.android.com/reference/android/content/res/AssetManager` | ` https://developer.android.com/reference/android/content/res/Resources#getAssets()() ` Retrieve underlying AssetManager storage for these resources. |
| ` static int` | ` https://developer.android.com/reference/android/content/res/Resources#getAttributeSetSourceResId(android.util.AttributeSet)(https://developer.android.com/reference/android/util/AttributeSet set) ` Returns the resource ID of the resource that was used to create this AttributeSet. |
| ` boolean` | ` https://developer.android.com/reference/android/content/res/Resources#getBoolean(int)(int id) ` Return a boolean associated with a particular resource ID. |
| ` int` | ` https://developer.android.com/reference/android/content/res/Resources#getColor(int)(int id) ` *This method was deprecated in API level 23. Use `https://developer.android.com/reference/android/content/res/Resources#getColor(int,%20android.content.res.Resources.Theme)` instead.* |
| ` int` | ` https://developer.android.com/reference/android/content/res/Resources#getColor(int,%20android.content.res.Resources.Theme)(int id, https://developer.android.com/reference/android/content/res/Resources.Theme theme) ` Returns a themed color integer associated with a particular resource ID. |
| ` https://developer.android.com/reference/android/content/res/ColorStateList` | ` https://developer.android.com/reference/android/content/res/Resources#getColorStateList(int,%20android.content.res.Resources.Theme)(int id, https://developer.android.com/reference/android/content/res/Resources.Theme theme) ` Returns a themed color state list associated with a particular resource ID. |
| ` https://developer.android.com/reference/android/content/res/ColorStateList` | ` https://developer.android.com/reference/android/content/res/Resources#getColorStateList(int)(int id) ` *This method was deprecated in API level 23. Use `https://developer.android.com/reference/android/content/res/Resources#getColorStateList(int,%20android.content.res.Resources.Theme)` instead.* |
| ` https://developer.android.com/reference/android/content/res/Configuration` | ` https://developer.android.com/reference/android/content/res/Resources#getConfiguration()() ` Return the current configuration that is in effect for this resource object. |
| ` float` | ` https://developer.android.com/reference/android/content/res/Resources#getDimension(int)(int id) ` Retrieve a dimensional for a particular resource ID. |
| ` int` | ` https://developer.android.com/reference/android/content/res/Resources#getDimensionPixelOffset(int)(int id) ` Retrieve a dimensional for a particular resource ID for use as an offset in raw pixels. |
| ` int` | ` https://developer.android.com/reference/android/content/res/Resources#getDimensionPixelSize(int)(int id) ` Retrieve a dimensional for a particular resource ID for use as a size in raw pixels. |
| ` https://developer.android.com/reference/android/util/DisplayMetrics` | ` https://developer.android.com/reference/android/content/res/Resources#getDisplayMetrics()() ` Returns the current display metrics that are in effect for this resource object. |
| ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/content/res/Resources#getDrawable(int,%20android.content.res.Resources.Theme)(int id, https://developer.android.com/reference/android/content/res/Resources.Theme theme) ` Return a drawable object associated with a particular resource ID and styled for the specified theme. |
| ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/content/res/Resources#getDrawable(int)(int id) ` *This method was deprecated in API level 22. Use `https://developer.android.com/reference/android/content/res/Resources#getDrawable(int,%20android.content.res.Resources.Theme)` instead.* |
| ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/content/res/Resources#getDrawableForDensity(int,%20int)(int id, int density) ` *This method was deprecated in API level 22. Use `https://developer.android.com/reference/android/content/res/Resources#getDrawableForDensity(int,%20int,%20android.content.res.Resources.Theme)` instead.* |
| ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/content/res/Resources#getDrawableForDensity(int,%20int,%20android.content.res.Resources.Theme)(int id, int density, https://developer.android.com/reference/android/content/res/Resources.Theme theme) ` Return a drawable object associated with a particular resource ID for the given screen density in DPI and styled for the specified theme. |
| ` float` | ` https://developer.android.com/reference/android/content/res/Resources#getFloat(int)(int id) ` Retrieve a floating-point value for a particular resource ID. |
| ` https://developer.android.com/reference/android/graphics/Typeface` | ` https://developer.android.com/reference/android/content/res/Resources#getFont(int)(int id) ` Return the Typeface value associated with a particular resource ID. |
| ` float` | ` https://developer.android.com/reference/android/content/res/Resources#getFraction(int,%20int,%20int)(int id, int base, int pbase) ` Retrieve a fractional unit for a particular resource ID. |
| ` int` | ` https://developer.android.com/reference/android/content/res/Resources#getIdentifier(java.lang.String,%20java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String name, https://developer.android.com/reference/java/lang/String defType, https://developer.android.com/reference/java/lang/String defPackage) ` Return a resource identifier for the given resource name. |
| ` int[]` | ` https://developer.android.com/reference/android/content/res/Resources#getIntArray(int)(int id) ` Return the int array associated with a particular resource ID. |
| ` int` | ` https://developer.android.com/reference/android/content/res/Resources#getInteger(int)(int id) ` Return an integer associated with a particular resource ID. |
| ` https://developer.android.com/reference/android/content/res/XmlResourceParser` | ` https://developer.android.com/reference/android/content/res/Resources#getLayout(int)(int id) ` Return an XmlResourceParser through which you can read a view layout description for the given resource ID. |
| ` https://developer.android.com/reference/android/graphics/Movie` | ` https://developer.android.com/reference/android/content/res/Resources#getMovie(int)(int id) ` *This method was deprecated in API level 29. Prefer `https://developer.android.com/reference/android/graphics/drawable/AnimatedImageDrawable`.* |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/res/Resources#getQuantityString(int,%20int,%20java.lang.Object[])(int id, int quantity, https://developer.android.com/reference/java/lang/Object formatArgs) ` Formats the string necessary for grammatically correct pluralization of the given resource ID for the given quantity, using the given arguments. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/res/Resources#getQuantityString(int,%20int)(int id, int quantity) ` Returns the string necessary for grammatically correct pluralization of the given resource ID for the given quantity. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/content/res/Resources#getQuantityText(int,%20int)(int id, int quantity) ` Returns the character sequence necessary for grammatically correct pluralization of the given resource ID for the given quantity. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/res/Resources#getResourceEntryName(int)(int resid) ` Return the entry name for a given resource identifier. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/res/Resources#getResourceName(int)(int resid) ` Return the full name for a given resource identifier. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/res/Resources#getResourcePackageName(int)(int resid) ` Return the package name for a given resource identifier. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/res/Resources#getResourceTypeName(int)(int resid) ` Return the type name for a given resource identifier. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/res/Resources#getString(int)(int id) ` Return the string value associated with a particular resource ID. It will be stripped of any styled text information. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/res/Resources#getString(int,%20java.lang.Object[])(int id, https://developer.android.com/reference/java/lang/Object formatArgs) ` Return the string value associated with a particular resource ID, substituting the format arguments as defined in `https://developer.android.com/reference/java/util/Formatter` and `https://developer.android.com/reference/java/lang/String#format(java.lang.String,%20java.lang.Object[])`. It will be stripped of any styled text information. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/res/Resources#getStringArray(int)(int id) ` Return the string array associated with a particular resource ID. |
| ` static https://developer.android.com/reference/android/content/res/Resources` | ` https://developer.android.com/reference/android/content/res/Resources#getSystem()() ` Return a global shared Resources object that provides access to only system resources (no application resources), is not configured for the current screen (can not use dimension units, does not change based on orientation, etc), and is not affected by Runtime Resource Overlay. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/content/res/Resources#getText(int,%20java.lang.CharSequence)(int id, https://developer.android.com/reference/java/lang/CharSequence def) ` Return the string value associated with a particular resource ID. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/content/res/Resources#getText(int)(int id) ` Return the string value associated with a particular resource ID. The returned object will be a String if this is a plain string; it will be some other type of CharSequence if it is styled. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/content/res/Resources#getTextArray(int)(int id) ` Return the styled text array associated with a particular resource ID. |
| ` void` | ` https://developer.android.com/reference/android/content/res/Resources#getValue(java.lang.String,%20android.util.TypedValue,%20boolean)(https://developer.android.com/reference/java/lang/String name, https://developer.android.com/reference/android/util/TypedValue outValue, boolean resolveRefs) ` Return the raw data associated with a particular resource ID. |
| ` void` | ` https://developer.android.com/reference/android/content/res/Resources#getValue(int,%20android.util.TypedValue,%20boolean)(int id, https://developer.android.com/reference/android/util/TypedValue outValue, boolean resolveRefs) ` Return the raw data associated with a particular resource ID. |
| ` void` | ` https://developer.android.com/reference/android/content/res/Resources#getValueForDensity(int,%20int,%20android.util.TypedValue,%20boolean)(int id, int density, https://developer.android.com/reference/android/util/TypedValue outValue, boolean resolveRefs) ` Get the raw value associated with a resource with associated density. |
| ` https://developer.android.com/reference/android/content/res/XmlResourceParser` | ` https://developer.android.com/reference/android/content/res/Resources#getXml(int)(int id) ` Return an XmlResourceParser through which you can read a generic XML resource for the given resource ID. |
| ` final https://developer.android.com/reference/android/content/res/Resources.Theme` | ` https://developer.android.com/reference/android/content/res/Resources#newTheme()() ` Generate a new Theme object for this set of Resources. |
| ` https://developer.android.com/reference/android/content/res/TypedArray` | ` https://developer.android.com/reference/android/content/res/Resources#obtainAttributes(android.util.AttributeSet,%20int[])(https://developer.android.com/reference/android/util/AttributeSet set, int[] attrs) ` Retrieve a set of basic attribute values from an AttributeSet, not performing styling of them using a theme and/or style resources. |
| ` https://developer.android.com/reference/android/content/res/TypedArray` | ` https://developer.android.com/reference/android/content/res/Resources#obtainTypedArray(int)(int id) ` Return an array of heterogeneous values. |
| ` https://developer.android.com/reference/java/io/InputStream` | ` https://developer.android.com/reference/android/content/res/Resources#openRawResource(int,%20android.util.TypedValue)(int id, https://developer.android.com/reference/android/util/TypedValue value) ` Open a data stream for reading a raw resource. |
| ` https://developer.android.com/reference/java/io/InputStream` | ` https://developer.android.com/reference/android/content/res/Resources#openRawResource(int)(int id) ` Open a data stream for reading a raw resource. |
| ` https://developer.android.com/reference/android/content/res/AssetFileDescriptor` | ` https://developer.android.com/reference/android/content/res/Resources#openRawResourceFd(int)(int id) ` Open a file descriptor for reading a raw resource. |
| ` void` | ` https://developer.android.com/reference/android/content/res/Resources#parseBundleExtra(java.lang.String,%20android.util.AttributeSet,%20android.os.Bundle)(https://developer.android.com/reference/java/lang/String tagName, https://developer.android.com/reference/android/util/AttributeSet attrs, https://developer.android.com/reference/android/os/Bundle outBundle) ` Parse a name/value pair out of an XML tag holding that data. |
| ` void` | ` https://developer.android.com/reference/android/content/res/Resources#parseBundleExtras(android.content.res.XmlResourceParser,%20android.os.Bundle)(https://developer.android.com/reference/android/content/res/XmlResourceParser parser, https://developer.android.com/reference/android/os/Bundle outBundle) ` Parse a series of `https://developer.android.com/reference/android/R.styleable#Extra` tags from an XML file. |
| ` static void` | ` https://developer.android.com/reference/android/content/res/Resources#registerResourcePaths(java.lang.String,%20android.content.pm.ApplicationInfo)(https://developer.android.com/reference/java/lang/String uniqueId, https://developer.android.com/reference/android/content/pm/ApplicationInfo appInfo) ` Register the resources paths of a package (e.g. a shared library). |
| ` void` | ` https://developer.android.com/reference/android/content/res/Resources#removeLoaders(android.content.res.loader.ResourcesLoader[])(https://developer.android.com/reference/android/content/res/loader/ResourcesLoader loaders) ` Removes loaders from the list of loaders. |
| ` void` | ` https://developer.android.com/reference/android/content/res/Resources#updateConfiguration(android.content.res.Configuration,%20android.util.DisplayMetrics)(https://developer.android.com/reference/android/content/res/Configuration config, https://developer.android.com/reference/android/util/DisplayMetrics metrics) ` *This method was deprecated in API level 25. See `https://developer.android.com/reference/android/content/Context#createConfigurationContext(android.content.res.Configuration)`.* |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### ID_NULL

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ID_NULL
```

The `null` resource ID. This denotes an invalid resource ID that is returned by the system when a resource is not found or the value is set to `@null` in XML.

<br />

Constant Value: 0 (0x00000000)

## Public constructors

### Resources

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Resources (AssetManager assets, 
                DisplayMetrics metrics, 
                Configuration config)
```

<br />

**This constructor is deprecated.**   

Resources should not be constructed by apps. See `https://developer.android.com/reference/android/content/Context#createConfigurationContext(android.content.res.Configuration)`.

Create a new Resources object on top of an existing set of assets in an AssetManager.

<br />

| Parameters ||
|---|---|
| `assets` | `AssetManager`: Previously created AssetManager. <br /> |
| `metrics` | `DisplayMetrics`: Current display metrics to consider when selecting/computing resource values. <br /> |
| `config` | `Configuration`: Desired device configuration to consider when selecting/computing resource values (optional). <br /> |

## Public methods

### addLoaders

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void addLoaders (ResourcesLoader... loaders)
```

Adds a loader to the list of loaders. If the loader is already present in the list, the list will not be modified.

This should only be called from the UI thread to avoid lock contention when propagating loader changes.

<br />

| Parameters ||
|---|---|
| `loaders` | `ResourcesLoader`: the loaders to add. This value cannot be `null`. <br /> |

### finishPreloading

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final void finishPreloading ()
```

Called by zygote when it is done preloading resources, to change back to normal Resources operation.

<br />

### flushLayoutCache

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final void flushLayoutCache ()
```

Call this to remove all cached loaded layout resources from the Resources object. Only intended for use with performance testing tools.

<br />

### getAnimation

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public XmlResourceParser getAnimation (int id)
```

Return an XmlResourceParser through which you can read an animation description for the given resource ID. This parser has limited functionality -- in particular, you can't change its input, and only the high-level events are available.

This function is really a simple wrapper for calling `https://developer.android.com/reference/android/content/res/Resources#getXml(int)` with an animation resource.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/XmlResourceParser` | A new parser object through which you can read the XML data. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

**See also:**

- `https://developer.android.com/reference/android/content/res/Resources#getXml(int)`

### getAssets

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final AssetManager getAssets ()
```

Retrieve underlying AssetManager storage for these resources.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/AssetManager` | <br /> |

### getAttributeSetSourceResId

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int getAttributeSetSourceResId (AttributeSet set)
```

Returns the resource ID of the resource that was used to create this AttributeSet.

<br />

| Parameters ||
|---|---|
| `set` | `AttributeSet`: AttributeSet for which we want to find the source. This value may be `null`. <br /> |

| Returns ||
|---|---|
| `int` | The resource ID for the source that is backing the given AttributeSet or `https://developer.android.com/reference/android/content/res/Resources#ID_NULL` if the AttributeSet is `null`. <br /> |

### getBoolean

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean getBoolean (int id)
```

Return a boolean associated with a particular resource ID. This can be used with any integral resource value, and will return true if it is non-zero.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `boolean` | Returns the boolean value contained in the resource. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getColor

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getColor (int id)
```

<br />

**This method was deprecated in API level 23.**   

Use `https://developer.android.com/reference/android/content/res/Resources#getColor(int,%20android.content.res.Resources.Theme)` instead.

Returns a color integer associated with a particular resource ID. If the resource holds a complex `https://developer.android.com/reference/android/content/res/ColorStateList`, then the default color from the set is returned.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `int` | A single color value in the form 0xAARRGGBB. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getColor

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getColor (int id, 
                Resources.Theme theme)
```

Returns a themed color integer associated with a particular resource ID. If the resource holds a complex `https://developer.android.com/reference/android/content/res/ColorStateList`, then the default color from the set is returned.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |
| `theme` | `Resources.Theme`: The theme used to style the color attributes, may be `null`. <br /> |

| Returns ||
|---|---|
| `int` | A single color value in the form 0xAARRGGBB. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getColorStateList

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ColorStateList getColorStateList (int id, 
                Resources.Theme theme)
```

Returns a themed color state list associated with a particular resource ID. The resource may contain either a single raw color value or a complex `https://developer.android.com/reference/android/content/res/ColorStateList` holding multiple possible colors.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier of a `https://developer.android.com/reference/android/content/res/ColorStateList`, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |
| `theme` | `Resources.Theme`: The theme used to style the color attributes, may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/ColorStateList` | A themed ColorStateList object containing either a single solid color or multiple colors that can be selected based on a state. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getColorStateList

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ColorStateList getColorStateList (int id)
```

<br />

**This method was deprecated in API level 23.**   

Use `https://developer.android.com/reference/android/content/res/Resources#getColorStateList(int,%20android.content.res.Resources.Theme)` instead.

Returns a color state list associated with a particular resource ID. The resource may contain either a single raw color value or a complex `https://developer.android.com/reference/android/content/res/ColorStateList` holding multiple possible colors.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier of a `https://developer.android.com/reference/android/content/res/ColorStateList`, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/ColorStateList` | A ColorStateList object containing either a single solid color or multiple colors that can be selected based on a state. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getConfiguration

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Configuration getConfiguration ()
```

Return the current configuration that is in effect for this resource object. The returned object should be treated as read-only.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Configuration` | The resource's current configuration. <br /> |

### getDimension

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getDimension (int id)
```

Retrieve a dimensional for a particular resource ID. Unit conversions are based on the current `https://developer.android.com/reference/android/util/DisplayMetrics` associated with the resources.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `float` | Resource dimension value multiplied by the appropriate metric to convert to pixels. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

**See also:**

- `https://developer.android.com/reference/android/content/res/Resources#getDimensionPixelOffset(int)`
- `https://developer.android.com/reference/android/content/res/Resources#getDimensionPixelSize(int)`

### getDimensionPixelOffset

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getDimensionPixelOffset (int id)
```

Retrieve a dimensional for a particular resource ID for use as an offset in raw pixels. This is the same as `https://developer.android.com/reference/android/content/res/Resources#getDimension(int)`, except the returned value is converted to integer pixels for you. An offset conversion involves simply truncating the base value to an integer.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `int` | Resource dimension value multiplied by the appropriate metric and truncated to integer pixels. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

**See also:**

- `https://developer.android.com/reference/android/content/res/Resources#getDimension(int)`
- `https://developer.android.com/reference/android/content/res/Resources#getDimensionPixelSize(int)`

### getDimensionPixelSize

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getDimensionPixelSize (int id)
```

Retrieve a dimensional for a particular resource ID for use as a size in raw pixels. This is the same as `https://developer.android.com/reference/android/content/res/Resources#getDimension(int)`, except the returned value is converted to integer pixels for use as a size. A size conversion involves rounding the base value, and ensuring that a non-zero base value is at least one pixel in size.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `int` | Resource dimension value multiplied by the appropriate metric and truncated to integer pixels. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

**See also:**

- `https://developer.android.com/reference/android/content/res/Resources#getDimension(int)`
- `https://developer.android.com/reference/android/content/res/Resources#getDimensionPixelOffset(int)`

### getDisplayMetrics

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DisplayMetrics getDisplayMetrics ()
```

Returns the current display metrics that are in effect for this resource object. The returned object should be treated as read-only.

Note that the reported value may be different than the window this application is interested in.

The best practices is to obtain metrics from `https://developer.android.com/reference/android/view/WindowManager#getCurrentWindowMetrics()` for window bounds. The value obtained from this API may be wrong if `https://developer.android.com/reference/android/content/Context#getResources()` is not from a `UiContext`. For example, use the `https://developer.android.com/reference/android/util/DisplayMetrics` obtained from `https://developer.android.com/reference/android/content/ContextWrapper#getResources()` to build `https://developer.android.com/reference/android/app/Activity` UI elements especially when the `https://developer.android.com/reference/android/app/Activity` is in the multi-window mode or on the secondary `https://developer.android.com/reference/android/view/Display`.

<br />

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/DisplayMetrics` | The resource's current display metrics. <br /> |

### getDrawable

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Drawable getDrawable (int id, 
                Resources.Theme theme)
```

Return a drawable object associated with a particular resource ID and styled for the specified theme. Various types of objects will be returned depending on the underlying resource -- for example, a solid color, PNG image, scalable image, etc.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |
| `theme` | `Resources.Theme`: The theme used to style the drawable attributes, may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable` | Drawable An object that can be used to draw this resource. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getDrawable

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 22](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Drawable getDrawable (int id)
```

<br />

**This method was deprecated in API level 22.**   

Use `https://developer.android.com/reference/android/content/res/Resources#getDrawable(int,%20android.content.res.Resources.Theme)` instead.

Return a drawable object associated with a particular resource ID. Various types of objects will be returned depending on the underlying resource -- for example, a solid color, PNG image, scalable image, etc. The Drawable API hides these implementation details.

**Note:** Prior to `https://developer.android.com/reference/android/os/Build.VERSION_CODES#JELLY_BEAN`, this function would not correctly retrieve the final configuration density when the resource ID passed here is an alias to another Drawable resource. This means that if the density configuration of the alias resource is different than the actual resource, the density of the returned Drawable would be incorrect, resulting in bad scaling. To work around this, you can instead manually resolve the aliased reference by using `https://developer.android.com/reference/android/content/res/Resources#getValue(int,%20android.util.TypedValue,%20boolean)` and passing `true` for `resolveRefs`. The resulting `https://developer.android.com/reference/android/util/TypedValue#resourceId` value may be passed to this method.

**Note:** To obtain a themed drawable, use `https://developer.android.com/reference/android/content/Context#getDrawable(int)` or `https://developer.android.com/reference/android/content/res/Resources#getDrawable(int,%20android.content.res.Resources.Theme)` passing the desired theme.

<br />

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable` | Drawable An object that can be used to draw this resource. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

**See also:**

- `https://developer.android.com/reference/android/content/res/Resources#getDrawable(int,%20android.content.res.Resources.Theme)`

### getDrawableForDensity

Added in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 22](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Drawable getDrawableForDensity (int id, 
                int density)
```

<br />

**This method was deprecated in API level 22.**   

Use `https://developer.android.com/reference/android/content/res/Resources#getDrawableForDensity(int,%20int,%20android.content.res.Resources.Theme)` instead.

Return a drawable object associated with a particular resource ID for the given screen density in DPI. This will set the drawable's density to be the device's density multiplied by the ratio of actual drawable density to requested density. This allows the drawable to be scaled up to the correct size if needed. Various types of objects will be returned depending on the underlying resource -- for example, a solid color, PNG image, scalable image, etc. The Drawable API hides these implementation details.

**Note:** To obtain a themed drawable, use `https://developer.android.com/reference/android/content/Context#getDrawable(int)` or `https://developer.android.com/reference/android/content/res/Resources#getDrawableForDensity(int,%20int,%20android.content.res.Resources.Theme)` passing the desired theme.

<br />

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |
| `density` | `int`: the desired screen density indicated by the resource as found in `https://developer.android.com/reference/android/util/DisplayMetrics`. A value of 0 means to use the density returned from `https://developer.android.com/reference/android/content/res/Resources#getConfiguration()`. This is equivalent to calling `https://developer.android.com/reference/android/content/res/Resources#getDrawable(int)`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable` | Drawable An object that can be used to draw this resource. This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

**See also:**

- `https://developer.android.com/reference/android/content/res/Resources#getDrawableForDensity(int,%20int,%20android.content.res.Resources.Theme)`

### getDrawableForDensity

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Drawable getDrawableForDensity (int id, 
                int density, 
                Resources.Theme theme)
```

Return a drawable object associated with a particular resource ID for the given screen density in DPI and styled for the specified theme.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |
| `density` | `int`: The desired screen density indicated by the resource as found in `https://developer.android.com/reference/android/util/DisplayMetrics`. A value of 0 means to use the density returned from `https://developer.android.com/reference/android/content/res/Resources#getConfiguration()`. This is equivalent to calling `https://developer.android.com/reference/android/content/res/Resources#getDrawable(int,%20android.content.res.Resources.Theme)`. <br /> |
| `theme` | `Resources.Theme`: The theme used to style the drawable attributes, may be `null` if the drawable cannot be decoded. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable` | Drawable An object that can be used to draw this resource. This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getFloat

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getFloat (int id)
```

Retrieve a floating-point value for a particular resource ID.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `float` | Returns the floating-point value contained in the resource. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist or is not a floating-point value. |

### getFont

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Typeface getFont (int id)
```

Return the Typeface value associated with a particular resource ID.

<br />

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Typeface` | Typeface The Typeface data associated with the resource. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getFraction

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getFraction (int id, 
                int base, 
                int pbase)
```

Retrieve a fractional unit for a particular resource ID.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |
| `base` | `int`: The base value of this fraction. In other words, a standard fraction is multiplied by this value. <br /> |
| `pbase` | `int`: The parent base value of this fraction. In other words, a parent fraction (nn%p) is multiplied by this value. <br /> |

| Returns ||
|---|---|
| `float` | Attribute fractional value multiplied by the appropriate base value. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getIdentifier

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getIdentifier (String name, 
                String defType, 
                String defPackage)
```

Return a resource identifier for the given resource name. A fully qualified resource name is of the form "package:type/entry". The first two components (package and type) are optional if defType and defPackage, respectively, are specified here.

Note: use of this function is discouraged. It is much more efficient to retrieve resources by identifier than by name.

<br />

| Parameters ||
|---|---|
| `name` | `String`: The name of the desired resource. <br /> |
| `defType` | `String`: Optional default resource type to find, if "type/" is not included in the name. Can be null to require an explicit type. <br /> |
| `defPackage` | `String`: Optional default package to find, if "package:" is not included in the name. Can be null to require an explicit package. <br /> |

| Returns ||
|---|---|
| `int` | int The associated resource identifier. Returns 0 if no such resource was found. (0 is not a valid resource ID.) <br /> |

### getIntArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int[] getIntArray (int id)
```

Return the int array associated with a particular resource ID.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `int[]` | The int array associated with the resource. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getInteger

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getInteger (int id)
```

Return an integer associated with a particular resource ID.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `int` | Returns the integer value contained in the resource. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getLayout

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public XmlResourceParser getLayout (int id)
```

Return an XmlResourceParser through which you can read a view layout description for the given resource ID. This parser has limited functionality -- in particular, you can't change its input, and only the high-level events are available.

This function is really a simple wrapper for calling `https://developer.android.com/reference/android/content/res/Resources#getXml(int)` with a layout resource.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/XmlResourceParser` | A new parser object through which you can read the XML data. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

**See also:**

- `https://developer.android.com/reference/android/content/res/Resources#getXml(int)`

### getMovie

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Movie getMovie (int id)
```

<br />

**This method was deprecated in API level 29.**   

Prefer `https://developer.android.com/reference/android/graphics/drawable/AnimatedImageDrawable`.

Return a movie object associated with the particular resource ID.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Movie` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getQuantityString

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getQuantityString (int id, 
                int quantity, 
                Object... formatArgs)
```

Formats the string necessary for grammatically correct pluralization of the given resource ID for the given quantity, using the given arguments. Note that the string is selected based solely on grammatical necessity, and that such rules differ between languages. Do not assume you know which string will be returned for a given quantity. See [String Resources](https://developer.android.com/guide/topics/resources/string-resource#Plurals) for more detail.

Substitution of format arguments works as if using `https://developer.android.com/reference/java/util/Formatter` and `https://developer.android.com/reference/java/lang/String#format(java.lang.String,%20java.lang.Object[])`. The resulting string will be stripped of any styled text information.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |
| `quantity` | `int`: The number used to get the correct string for the current language's plural rules. <br /> |
| `formatArgs` | `Object`: The format arguments that will be used for substitution. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | String The string data associated with the resource, stripped of styled text information. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getQuantityString

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getQuantityString (int id, 
                int quantity)
```

Returns the string necessary for grammatically correct pluralization of the given resource ID for the given quantity. Note that the string is selected based solely on grammatical necessity, and that such rules differ between languages. Do not assume you know which string will be returned for a given quantity. See [String Resources](https://developer.android.com/guide/topics/resources/string-resource#Plurals) for more detail.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |
| `quantity` | `int`: The number used to get the correct string for the current language's plural rules. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | String The string data associated with the resource, stripped of styled text information. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getQuantityText

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CharSequence getQuantityText (int id, 
                int quantity)
```

Returns the character sequence necessary for grammatically correct pluralization of the given resource ID for the given quantity. Note that the character sequence is selected based solely on grammatical necessity, and that such rules differ between languages. Do not assume you know which string will be returned for a given quantity. See [String Resources](https://developer.android.com/guide/topics/resources/string-resource#Plurals) for more detail.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |
| `quantity` | `int`: The number used to get the correct string for the current language's plural rules. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | CharSequence The string data associated with the resource, plus possibly styled text information. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getResourceEntryName

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getResourceEntryName (int resid)
```

Return the entry name for a given resource identifier.

<br />

| Parameters ||
|---|---|
| `resid` | `int`: The resource identifier whose entry name is to be retrieved. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | A string holding the entry name of the resource. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

**See also:**

- `https://developer.android.com/reference/android/content/res/Resources#getResourceName(int)`

### getResourceName

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getResourceName (int resid)
```

Return the full name for a given resource identifier. This name is a single string of the form "package:type/entry".

<br />

| Parameters ||
|---|---|
| `resid` | `int`: The resource identifier whose name is to be retrieved. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | A string holding the name of the resource. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

**See also:**

- `https://developer.android.com/reference/android/content/res/Resources#getResourcePackageName(int)`
- `https://developer.android.com/reference/android/content/res/Resources#getResourceTypeName(int)`
- `https://developer.android.com/reference/android/content/res/Resources#getResourceEntryName(int)`

### getResourcePackageName

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getResourcePackageName (int resid)
```

Return the package name for a given resource identifier.

<br />

| Parameters ||
|---|---|
| `resid` | `int`: The resource identifier whose package name is to be retrieved. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | A string holding the package name of the resource. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

**See also:**

- `https://developer.android.com/reference/android/content/res/Resources#getResourceName(int)`

### getResourceTypeName

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getResourceTypeName (int resid)
```

Return the type name for a given resource identifier.

<br />

| Parameters ||
|---|---|
| `resid` | `int`: The resource identifier whose type name is to be retrieved. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | A string holding the type name of the resource. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

**See also:**

- `https://developer.android.com/reference/android/content/res/Resources#getResourceName(int)`

### getString

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getString (int id)
```

Return the string value associated with a particular resource ID. It will be stripped of any styled text information.

<br />

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | String The string data associated with the resource, stripped of styled text information. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getString

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getString (int id, 
                Object... formatArgs)
```

Return the string value associated with a particular resource ID, substituting the format arguments as defined in `https://developer.android.com/reference/java/util/Formatter` and `https://developer.android.com/reference/java/lang/String#format(java.lang.String,%20java.lang.Object[])`. It will be stripped of any styled text information.

<br />

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |
| `formatArgs` | `Object`: The format arguments that will be used for substitution. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | String The string data associated with the resource, stripped of styled text information. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getStringArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] getStringArray (int id)
```

Return the string array associated with a particular resource ID.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The string array associated with the resource. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getSystem

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Resources getSystem ()
```

Return a global shared Resources object that provides access to only system resources (no application resources), is not configured for the current screen (can not use dimension units, does not change based on orientation, etc), and is not affected by Runtime Resource Overlay.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources` | <br /> |

### getText

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CharSequence getText (int id, 
                CharSequence def)
```

Return the string value associated with a particular resource ID. The returned object will be a String if this is a plain string; it will be some other type of CharSequence if it is styled.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |
| `def` | `CharSequence`: The default CharSequence to return. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | CharSequence The string data associated with the resource, plus possibly styled text information, or def if id is 0 or not found. <br /> |

### getText

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CharSequence getText (int id)
```

Return the string value associated with a particular resource ID. The returned object will be a String if this is a plain string; it will be some other type of CharSequence if it is styled.

<br />

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | CharSequence The string data associated with the resource, plus possibly styled text information. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getTextArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CharSequence[] getTextArray (int id)
```

Return the styled text array associated with a particular resource ID.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | The styled text array associated with the resource. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getValue

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void getValue (String name, 
                TypedValue outValue, 
                boolean resolveRefs)
```

Return the raw data associated with a particular resource ID. See getIdentifier() for information on how names are mapped to resource IDs, and getString(int) for information on how string resources are retrieved.

Note: use of this function is discouraged. It is much more efficient to retrieve resources by identifier than by name.

<br />

| Parameters ||
|---|---|
| `name` | `String`: The name of the desired resource. This is passed to getIdentifier() with a default type of "string". <br /> |
| `outValue` | `TypedValue`: Object in which to place the resource data. <br /> |
| `resolveRefs` | `boolean`: If true, a resource that is a reference to another resource will be followed so that you receive the actual final resource data. If false, the TypedValue will be filled in with the reference itself. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getValue

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void getValue (int id, 
                TypedValue outValue, 
                boolean resolveRefs)
```

Return the raw data associated with a particular resource ID.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |
| `outValue` | `TypedValue`: Object in which to place the resource data. <br /> |
| `resolveRefs` | `boolean`: If true, a resource that is a reference to another resource will be followed so that you receive the actual final resource data. If false, the TypedValue will be filled in with the reference itself. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### getValueForDensity

Added in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void getValueForDensity (int id, 
                int density, 
                TypedValue outValue, 
                boolean resolveRefs)
```

Get the raw value associated with a resource with associated density.

<br />

| Parameters ||
|---|---|
| `id` | `int`: resource identifier <br /> |
| `density` | `int`: density in DPI <br /> |
| `outValue` | `TypedValue` <br /> |
| `resolveRefs` | `boolean`: If true, a resource that is a reference to another resource will be followed so that you receive the actual final resource data. If false, the TypedValue will be filled in with the reference itself. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

**See also:**

- `https://developer.android.com/reference/android/content/res/Resources#getValue(java.lang.String,%20android.util.TypedValue,%20boolean)`

### getXml

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public XmlResourceParser getXml (int id)
```

Return an XmlResourceParser through which you can read a generic XML resource for the given resource ID.

The XmlPullParser implementation returned here has some limited functionality. In particular, you can't change its input, and only high-level parsing events are available (since the document was pre-parsed for you at build time, which involved merging text and stripping comments).

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/XmlResourceParser` | A new parser object through which you can read the XML data. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

**See also:**

- `https://developer.android.com/reference/android/util/AttributeSet`

### newTheme

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final Resources.Theme newTheme ()
```

Generate a new Theme object for this set of Resources. It initially starts out empty.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.Theme` | Theme The newly created Theme container. <br /> |

### obtainAttributes

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public TypedArray obtainAttributes (AttributeSet set, 
                int[] attrs)
```

Retrieve a set of basic attribute values from an AttributeSet, not performing styling of them using a theme and/or style resources.

<br />

| Parameters ||
|---|---|
| `set` | `AttributeSet`: The current attribute values to retrieve. <br /> |
| `attrs` | `int`: The specific attributes to be retrieved. These attribute IDs must be sorted in ascending order. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray` | Returns a TypedArray holding an array of the attribute values. Be sure to call `https://developer.android.com/reference/android/content/res/TypedArray#recycle()` when done with it. <br /> |

**See also:**

- `https://developer.android.com/reference/android/content/res/Resources.Theme#obtainStyledAttributes(android.util.AttributeSet,%20int[],%20int,%20int)`

### obtainTypedArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public TypedArray obtainTypedArray (int id)
```

Return an array of heterogeneous values.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/TypedArray` | Returns a TypedArray holding an array of the array values. Be sure to call `https://developer.android.com/reference/android/content/res/TypedArray#recycle()` when done with it. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### openRawResource

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public InputStream openRawResource (int id, 
                TypedValue value)
```

Open a data stream for reading a raw resource. This can only be used with resources whose value is the name of an asset file -- that is, it can be used to open drawable, sound, and raw resources; it will fail on string and color resources.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The resource identifier to open, as generated by the aapt tool. <br /> |
| `value` | `TypedValue`: The TypedValue object to hold the resource information. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/InputStream` | InputStream Access to the resource data. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### openRawResource

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public InputStream openRawResource (int id)
```

Open a data stream for reading a raw resource. This can only be used with resources whose value is the name of an asset files -- that is, it can be used to open drawable, sound, and raw resources; it will fail on string and color resources.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The resource identifier to open, as generated by the aapt tool. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/InputStream` | InputStream Access to the resource data. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### openRawResourceFd

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public AssetFileDescriptor openRawResourceFd (int id)
```

Open a file descriptor for reading a raw resource. This can only be used with resources whose value is the name of an asset files -- that is, it can be used to open drawable, sound, and raw resources; it will fail on string and color resources.

This function only works for resources that are stored in the package as uncompressed data, which typically includes things like mp3 files and png images.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The resource identifier to open, as generated by the aapt tool. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/AssetFileDescriptor` | AssetFileDescriptor A new file descriptor you can use to read the resource. This includes the file descriptor itself, as well as the offset and length of data where the resource appears in the file. A null is returned if the file exists but is compressed. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.NotFoundException` | Throws NotFoundException if the given ID does not exist. |

### parseBundleExtra

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void parseBundleExtra (String tagName, 
                AttributeSet attrs, 
                Bundle outBundle)
```

Parse a name/value pair out of an XML tag holding that data. The AttributeSet must be holding the data defined by `https://developer.android.com/reference/android/R.styleable#Extra`. The following value types are supported:

- `https://developer.android.com/reference/android/util/TypedValue#TYPE_STRING`: `https://developer.android.com/reference/android/os/Bundle#putCharSequence(java.lang.String,%20java.lang.CharSequence)`
- `https://developer.android.com/reference/android/util/TypedValue#TYPE_INT_BOOLEAN`: `https://developer.android.com/reference/android/os/Bundle#putCharSequence(java.lang.String,%20java.lang.CharSequence)`
- `https://developer.android.com/reference/android/util/TypedValue#TYPE_FIRST_INT`-`https://developer.android.com/reference/android/util/TypedValue#TYPE_LAST_INT`: `https://developer.android.com/reference/android/os/Bundle#putCharSequence(java.lang.String,%20java.lang.CharSequence)`
- `https://developer.android.com/reference/android/util/TypedValue#TYPE_FLOAT`: `https://developer.android.com/reference/android/os/Bundle#putCharSequence(java.lang.String,%20java.lang.CharSequence)`

<br />

<br />

| Parameters ||
|---|---|
| `tagName` | `String`: The name of the tag these attributes come from; this is only used for reporting error messages. <br /> |
| `attrs` | `AttributeSet`: The attributes from which to retrieve the name/value pair. <br /> |
| `outBundle` | `Bundle`: The Bundle in which to place the parsed value. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/org/xmlpull/v1/XmlPullParserException` | If the attributes are not valid. |

### parseBundleExtras

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void parseBundleExtras (XmlResourceParser parser, 
                Bundle outBundle)
```

Parse a series of `https://developer.android.com/reference/android/R.styleable#Extra` tags from an XML file. You call this when you are at the parent tag of the extra tags, and it will return once all of the child tags have been parsed. This will call `https://developer.android.com/reference/android/content/res/Resources#parseBundleExtra(java.lang.String,%20android.util.AttributeSet,%20android.os.Bundle)` for each extra tag encountered.

<br />

| Parameters ||
|---|---|
| `parser` | `XmlResourceParser`: The parser from which to retrieve the extras. <br /> |
| `outBundle` | `Bundle`: A Bundle in which to place all parsed extras. <br /> |

| Throws ||
|---|---|
|   | java.io.IOException |
|   | org.xmlpull.v1.XmlPullParserException |
| `https://developer.android.com/reference/java/io/IOException` |   |
| `https://developer.android.com/reference/org/xmlpull/v1/XmlPullParserException` |   |

### registerResourcePaths

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void registerResourcePaths (String uniqueId, 
                ApplicationInfo appInfo)
```

Register the resources paths of a package (e.g. a shared library). This will collect the package resources' paths from its ApplicationInfo and add them to all existing and future contexts while the application is running. A second call with the same uniqueId is a no-op. The paths are not persisted during application restarts. The application is responsible for calling the API again if this happens.

<br />

| Parameters ||
|---|---|
| `uniqueId` | `String`: The unique id for the ApplicationInfo object, to detect and ignore repeated API calls. This value cannot be `null`. <br /> |
| `appInfo` | `ApplicationInfo`: The ApplicationInfo that contains resources paths of the package. This value cannot be `null`. <br /> |

### removeLoaders

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void removeLoaders (ResourcesLoader... loaders)
```

Removes loaders from the list of loaders. If the loader is not present in the list, the list will not be modified.

This should only be called from the UI thread to avoid lock contention when propagating loader changes.

<br />

| Parameters ||
|---|---|
| `loaders` | `ResourcesLoader`: the loaders to remove. This value cannot be `null`. <br /> |

### updateConfiguration

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 25](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void updateConfiguration (Configuration config, 
                DisplayMetrics metrics)
```

<br />

**This method was deprecated in API level 25.**   

See `https://developer.android.com/reference/android/content/Context#createConfigurationContext(android.content.res.Configuration)`.

Store the newly updated configuration.

<br />

| Parameters ||
|---|---|
| `config` | `Configuration` <br /> |
| `metrics` | `DisplayMetrics` <br /> |