Skip to content

Most visited

Recently visited

navigation

AppCompatResources

public final class AppCompatResources
extends Object

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


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

Summary

Public methods

static ColorStateList getColorStateList(Context context, int resId)

Returns the ColorStateList from the given resource.

static Drawable getDrawable(Context context, int resId)

Return a drawable object associated with a particular resource ID.

Inherited methods

From class java.lang.Object

Public methods

getColorStateList

added in version 24.0.0
ColorStateList getColorStateList (Context context, 
                int resId)

Returns the ColorStateList from the given resource. The resource can include themeable attributes, regardless of API level.

Parameters
context Context: context to inflate against

resId int: the resource identifier of the ColorStateList to retrieve

Returns
ColorStateList

getDrawable

added in version 24.2.0
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.

Parameters
context Context: context to inflate against

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.

Returns
Drawable Drawable An object that can be used to draw this resource.

See also:

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.