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! While you're at it, check out some resources Treehouse students have shared here.

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

Android Build a Weather App (2015) Working with JSON Setting the Weather Icon

medev21
medev21
18,291 Points

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?

2 Answers

medev21
medev21
18,291 Points

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 Bone
Stephen Bone
12,359 Points

Great! Glad I could help.

Stephen Bone
Stephen Bone
12,359 Points

Hi Martin

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!

Stephen

medev21
medev21
18,291 Points

Hi Stephen,

When I copied the images, all I did was right click on the folder and selected show in explorer, then i copied the images to the drawable folder, though the default folders were not there before i copied the images, so there was no need to replace/overwrite.

From the android view, the drawable folder appears empty, and if i show it in explorer, the drawable folders/content are displayed. I tried to clean project, sync it, and nothing seems to be working. Do I need to create a new drawable directory/folder? If so, how do you do that?

Thanks for helping me on this issue.