views:

44

answers:

1
<resources>
    <drawable name="red">#7f00</drawable>
....
    <color name="solid_red">#f00</color>
.....
</resources>

This is some part of the colors.xml from android samples directory.

Now my question is that, what is the difference between defining a color in <drawable> tag and <color> tag ?

+1  A: 

Basically nothing. They both create a resource that is a "color" value holding a 32 bit color. One is just a drawable subtype, one is a color subtype. When you retrieve a Drawable from resources, if the resource is actually a color constant it knows how to create a Drawable object for that.

hackbod
thanks hackbod..
Vijay C