java.lang.Object | |
↳ | android.support.v4.content.res.ResourcesCompat |
Helper for accessing features in Resources
introduced after API level 4 in a backwards compatible fashion.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return a drawable object associated with a particular resource ID and
styled for the specified theme.
| |||||||||||
Return a drawable object associated with a particular resource ID for
the given screen density in DPI and styled for the specified theme.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
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.
Prior to API level 21, the theme will not be applied and this method
simply calls through to getDrawable(int)
.
id | 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. |
---|---|
theme | The theme used to style the drawable attributes, may be
null . |
Resources.NotFoundException | Throws NotFoundException if the given ID does not exist. |
---|
Return a drawable object associated with a particular resource ID for the given screen density in DPI and styled for the specified theme.
Prior to API level 15, the theme and density will not be applied and
this method simply calls through to getDrawable(int)
.
Prior to API level 21, the theme will not be applied and this method calls through to Resources.getDrawableForDensity(int, int).
id | 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. |
---|---|
density | The desired screen density indicated by the resource as
found in DisplayMetrics . |
theme | The theme used to style the drawable attributes, may be
null . |
Resources.NotFoundException | Throws NotFoundException if the given ID does not exist. |
---|