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

Setting the Weather Icon: Directions for dragging drawables for Windows?

What are the directions for dragging or copy/pasting the drawables from my downloads folder to the res folder in Windows? I right click the res folder and click "show in Explorer" in the context menu. Then I drag the drawable folders into the res folder. But it results in populating each drawable folder with all of the images of that resolution. I do not get folders of each image populated with the four drawable images of that image.

I guess I could copy/paste each individual image, one for each resolution, into the many folders, to get it like on the video. But isn't there an easier way to do this in Windows, like there is on the Mac?

The Res file structure has the subfolders: drawable, drawable-hdpi, drawable-mdpi, drawable-xhdpi, and drawable-xxhdpi all on the same level, as first level subfolders of Res. Since I do not have an answer, I will have to copy/paste manually, and hope it works.

No, it doesn't work. All four PNG files have exactly the same name. Unless I can find out about putting each image with a distinctive name, then I'm stuck. Help!

9 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

I got this to work on the latest version of Android Studio by following these steps below. Really hope this helps!

1) Project pane (with "Android" selected in the dropdown).

Imgur

2) Right-click on res and select "Show in Explorer".

Imgur

3) Copy the 4 drawable folders from the zip file into the res folder that was opened.

Imgur

4) You may have to right-click on res again and select "Synchronize 'res'".

Imgur

5) Final res in "Android" project mode:

Imgur

6) Final res in "Project" project mode:

Imgur

Kenneth Myers
Kenneth Myers
16,009 Points

Thank you so much! This seems to work I'm really glad I didn't get to this stage before this fix was found.

Yes, that's the way to do it! I believe I had 'Project' on the dropdown all the time, and maybe what I needed to do was change it to 'Android' for this copy/paste process to work right.

Alex Londono
Alex Londono
2,033 Points

Bingo!!! Thank you.

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Hi David,

Sorry for your trouble here! I need to get to a Windows laptop to try this out, but for the moment, can you try switching from "Android" to "Project" view in your Project pane? That might allow you to drag and drop more effectively:

Imgur

Glad to see he just left you hanging like that. Thanks Ben.

I already am in Project view. I've been in Project view all along.

I cannot keep both Explorer windows on top, so I right-click drag the copied folders from Downloads down to hover over the Explorer on my taskbar. Then, the Res folder thumbnail appears and I hover over that to open up the Res folder, and I release my right finger in order to paste into Res folder. This does paste the drawables, but I don't get the four of each size drawable folders that you have in the Project pane.

Vlad Sirbu
Vlad Sirbu
2,716 Points
  1. Copy your folders in windows explorer
  2. Go to Project view, then app\src\main
  3. Right click on "res" and choose Paste and then OK
  4. Overwrite all

Hope it helps!

No, pasting into the res folder in the left pane in Project view creates the four Drawable folders under res, drawable-hdpi, ... . I do not see the overwrite window. I cannot get the folders with four of each size.

Ben Jakuben
Ben Jakuben
Treehouse Teacher

David, it looks like you'll need to copy things in the file system itself. Right-click on your drawable folder in Android Studio and select "Reveal in Explorer" (or whatever it says for Windows). Then you can copy the files and folders in there directly, and when you come back to Android Studio they all should show up after a moment to refresh.

No, sorry. This is about the same thing I did originally, but it doesn't work for me in Windows. I think you mean to copy from Downloads and paste into the Res folder's Drawable folder ("show in Explorer"). I end up with four folders of the four sizes of images. I'm trying to get folders containing each of the four sizes of the images.

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

I'm really sorry to have dropped this thread. We get a lot of support requests in the forum and via other channels and unfortunately this one fell through the cracks. If either of you or anyone else is still having trouble with this please let me know and I'll see if I can recreate it and then explain a solution.

jenyufu
jenyufu
3,311 Points

yo ben, the reason why its not working is because in Windows you don't have to replace. Windows don't have default drawable for somereason, only mipmap-hdpi mipmap-mdpi mipmap-xhdpi mimmap-xxhdpi . So I think you are suppose to just copy and paste it into the res folder

Yes, please try a solution in Windows. I have Win8.1. I cannot get all four sizes of each drawable in a folder of each name. If you can do it in Windows, then I should, too.