By Alvin Alexander. Last updated: June 6, 2016
Without looking things up I don’t know when this changed, but ... to refer to a built-in Android color with the android:drawable
XML tag, use code like this:
<item android:state_activated="true" android:drawable="@android:color/darker_gray" /> <item android:state_checked="true" android:drawable="@android:color/background_dark" />
From what I’ve seen there used to be a drawable syntax different than @android:color/darker_gray
, but I can confirm that this syntax works with Android 5.