# AppCompatResources

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:appcompat-v7:28.0.0-alpha1  
Summary:[Methods](https://developer.android.com/reference/android/support/v7/content/res/AppCompatResources#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v7/content/res/AppCompatResources#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v7/content/res/AppCompatResources#)  

# AppCompatResources

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public

final

class
AppCompatResources
`  
`

extends Object


``


`

|---|---------------------------------------------------|
| java.lang.Object                                     ||
| ↳ | android.support.v7.content.res.AppCompatResources |

<br />

*** ** * ** ***

Class for accessing an application's resources through AppCompat, and thus any backward compatible functionality.

## Summary

|                                                                                                                                                                                                                                                      ### Public methods                                                                                                                                                                                                                                                      ||
|-------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static `[ColorStateList](https://developer.android.com/reference/android/content/res/ColorStateList.html) | ` `[getColorStateList](https://developer.android.com/reference/android/support/v7/content/res/AppCompatResources#getColorStateList(android.content.Context, int))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, int resId) ` Returns the[ColorStateList](https://developer.android.com/reference/android/content/res/ColorStateList.html)from the given resource. |
| ` static `[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html)       | ` `[getDrawable](https://developer.android.com/reference/android/support/v7/content/res/AppCompatResources#getDrawable(android.content.Context, int))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, int resId) ` Return a drawable object associated with a particular resource ID.                                                                               |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v7/content/res/AppCompatResources#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Public methods

### getColorStateList

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
ColorStateList getColorStateList (Context context, 
                int resId)
```

Returns the[ColorStateList](https://developer.android.com/reference/android/content/res/ColorStateList.html)from the given resource. The resource can include themeable attributes, regardless of API level.

<br />

|                                     Parameters                                     ||
|-----------|-------------------------------------------------------------------------|
| `context` | `Context`: context to inflate against <br />                            |
| `resId`   | `int`: the resource identifier of the ColorStateList to retrieve <br /> |

|                                                  Returns                                                  ||
|---------------------------------------------------------------------------------------------------|--------|
| [ColorStateList](https://developer.android.com/reference/android/content/res/ColorStateList.html) | <br /> |

### getDrawable

added in[version 25.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Drawable getDrawable (Context context, 
                int resId)
```

Return a drawable object associated with a particular resource ID.

This method supports inflation of`<vector>`and`<animated-vector>`resources on devices where platform support is not available.

<br />

<br />

|                                                                                         Parameters                                                                                         ||
|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `context` | `Context`: context to inflate against <br />                                                                                                                                    |
| `resId`   | `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                                                                             ||
|---------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| [Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html) | Drawable An object that can be used to draw this resource. <br /> |

**See also:**

- [getDrawable(Context, int)](https://developer.android.com/reference/android/support/v4/content/ContextCompat#getDrawable(android.content.Context, int))  
-

  ## Classes

  - [AppCompatResources](https://developer.android.com/reference/android/support/v7/content/res/AppCompatResources)