Each of the documents in this section describe the usage, format and syntax for a certain type
of application resource that you can provide in your resources directory (res/
).
Here's a brief summary of each resource type:
R.id
Is Not a ResourceYou will often use an R.id
integer to handle View
objects in
your UI. Although the id
is a subclass of the R
class, it is not considered a
"resource" because it is not a reference to an externalized application resource. The id
is simply a unique identifier that allows you to handle elements in your UI by instantiating
objects with findViewById()
.
For information about using R.id
with your UI, see Declaring Layout.
res/anim/
and accessed from the R.anim
class.res/drawable/
and accessed from the R.drawable
class.res/color/
and accessed from the R.color
class.res/drawable/
and accessed from the R.drawable
class.res/layout/
and accessed from the R.layout
class.res/menu/
and accessed from the R.menu
class.res/values/
and accessed from the R.string
, R.array
,
and R.plurals
classes.res/values/
and accessed from the R.style
class.res/values/
but each accessed from unique R
sub-classes (such as R.bool
, R.integer
, R.dimen
, etc.).