I created the folders:
app_name/res/drawable-hdpi
app_name/res/drawable-mdpi
app_name/res/drawable-ldpi
I put icons 72×72 in hdpi, 48×48 in mdpi, and 36×36 in ldpi. I named the png icons: icon.png
I compiled and ran it and the icons didn't change. So then I went to AndroidManifest.xml
and changed the icon parameter:
<application
android:icon="@drawable-ldpi/icon"
...
However I get this error:
Error: No resource found that matches the given name (at 'icon' with value '@drawable-ldpi/icon'). AndroidManifest.xml
Any tips?
Best Answer
adding the dpi to the drawable is invalid. You should just be able to set it like so in the manifest:
The typical folder structure is as follows:
Once you've done this, you'll probably need to do a clean (eclipse -> project -> clean), but you'll know it was successful if a line like this appears in your
/gen/R.java
file:If it isn't, you can delete the R.java file and the ADT will immediately panic and rebuild it from scratch, incorporating your new drawables.
As a final note, sometimes the emulator seems to cling to the old icon - the clean should make it change, but if it doesn't, go into settings and uninstall the application and then run again from eclipse, everything should REALLY be clean (the same applies to actual devices as well)
NOTE the answer now includes the comments below