Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Drawable folders not displaying on Android mode (Project Pane)
I'm getting an error when setting the iconId = R.drawable.clear_day;
The clear_day appears in red and it's not being recognized. I noticed the drawable folder is empty (hdpi,mdpi,etc are gone) when the project pane is set to android, but if i switch it to project, the folders are there. Could this be linked to the error I'm getting?
I found my mistake, I pasted the drawable folders (hdpi, mdpi, etc) under the drawable folder which should have been under the res folder instead. Error is gone and I'm good to go.
Thanks for taking time to help me.
Stephen Bone12,359 Points
It seems like the images haven't been copied over properly (possibly?).
From the Android view it will display the contents of the drawable folder a little bit differently. So rather than seeing the structure as:
->res --->drawable-hdpi ------>clear_day.png ------>clear-night.png ------>... etc --->drawable-mdpi ------>clear_day.png ------>clear-night.png ------>... etc --->... etc
It will show as:
->res --->drawable ------>clear_day.png(4) --------->clear_day.png(hdpi) --------->clear_day.png(mdpi) --------->... etc ------>clear-night.png(4) --------->clear_night.png(hdpi) --------->clear_night.png(mdpi) --------->... etc ------>... etc
However if you right click on the drawable folder and select Show in Explorer the actual folder structure should match that of the first example. So I would check that first and let me know the outcome.
Hope it helps!