Kaloyan Roussev
Kaloyan Roussev

Reputation: 14711

Drawable folders structure and files

So I am creating the icons for my action bar and Im having a very stupid problem, I suppose, but I cant get over it.

I have the following folders:

drawable drawable-hdpi drawable-ldpi drawable-mdpi drawable-xhdpi

and in the last 4 folders I have different versions of my icons with different sizes.

Problem comes when I define the icons in the action_bar.xml file:

<item
    android:id="@+id/abSettings"
    android:icon="@drawable/ic_action_device_access_storage"
    android:title="@string/abSettings"
    android:showAsAction="always"/>

I get an error saying it cant find this file in "drawable" which is true.

So which version of the images should I put in the drawable folder?

Upvotes: 0

Views: 303

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006539

I get an error saying it cant find this file in "drawable" which is true

You are not specifying a folder. You are specifying a type of resource (here, drawable). If you look one line below, you do not have a string folder, either -- that's a reference to a string resource.

So which version of the images should I put in the drawable folder?

None of them. Presumably, you have a typo somewhere. If you are using Eclipse, switch to the graphical editor and try choosing a resource for it in there.

res/drawable/ is usually reserved for XML drawables (e.g., LevelListDrawable, StateListDrawable), as they do not have an intrinsic density.

Upvotes: 2

Related Questions