0

I've created a directory inside drawable directory which contains two icons "empty_star.png". Now how to give address of these icons in style.xml

i tried following:

 <item android:state_selected="true"
    android:state_window_focused="true"
    android:drawable="drawable/icons/empty_star" />

<item android:drawable="drawable/icons/empty_star" />

but it shows error.

i also tried @drwable/icons/empty_star but still getting error.

Manush Chand
  • 17
  • 1
  • 5

3 Answers3

0

Try this:

android:drawable="@drawable/empty_star"
max59
  • 606
  • 1
  • 7
  • 16
  • this is alos showing error. this thing is working when i place icon inside drawbale directory. but i've created another directory inside drawble in which i've stored icons. – Manush Chand Jan 06 '15 at 07:11
  • Android does not support subfolders in the drawable directory. You should keep all the images in the `/res/drawable` directory. – max59 Jan 06 '15 at 07:18
0

The resources mechanism doesn't support subfolders in the drawable directory. You need to keep that hierarchy flat. Place your images in drawable folder and use it as android:drawable="@drawable/empty_star"

Hemanth
  • 2,717
  • 2
  • 21
  • 29
0

Can the Android drawable directory contain subdirectories?

According to the answer posted earlier, resource mechanism does not support sub folders in drawable folder. So you should maintain flat hierarchy.

Community
  • 1
  • 1
Vilas
  • 1,695
  • 1
  • 13
  • 13