This code causes force close exception on Emulator(API 18) and works in ASUS Nexus 7(API 21)
I think the best way of doing this is, first create a xml file inside the "drawable" folder and do something like below.
e.g. light_gray.xml then do something like below.
once you have saved it.
change you code like below.
But make sure to put the file light_gray.xml only to "drawable" folder. Do not put the same file to "drawable-hdpi or drawable-hdpi-v4 and so on"