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 an Interactive Story App (Retired) User Input Introducing ImageViews

jonasmanser
jonasmanser
2,277 Points

Can't find the images in the Resources tab for adding a source to the Imageview.

I'm using the newest version 1.3.2. When I try to add the image to the imageview, I can't select any of the images. I checked and they are in the drawable folder of the project.

4 Answers

Seth Kroger
Seth Kroger
56,413 Points

The various drawable directories need to be alongside each other in res, not inside drawable. Your current file tree is like this...

res
|--drawable
|   |--drawable-hdpi
|   |--drawable-mdpi
|   \--[other drawable folders...]
|
|--layout
\--[etc...]

Instead it should look like this.

res
|--drawable
|--drawable-hdpi
|--drawable-mdpi
|--[other drawable folders...]
|--layout
\--[etc...]

You can take a look at the official docs on providing resources here: http://developer.android.com/guide/topics/resources/providing-resources.html

Seth Kroger
Seth Kroger
56,413 Points

The images download has the files in 'drawable-*dpi' folders. Did you copy/move the files to the existing 'drawable-*dpi' folders in the project [correct], or copy/move the folders into 'drawable'?

jonasmanser
jonasmanser
2,277 Points

Hi, thanks for the answer. My current android studio looks like this at the moment. When I open, let's say the main_title.png, it shows the correct images. But in the Resources tab I can't find them anywhere to add them to the ImageView.

http://imgur.com/zntOlWl

jonasmanser
jonasmanser
2,277 Points

I tried copying just one main_title pciture into the drawable main folder (instead of the drawable-hdpi) and it shows up now... but that's just a temporary fix.

jonasmanser
jonasmanser
2,277 Points

Thanks, that fixed it!