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

Justin Mamaril
Justin Mamaril
3,895 Points

Once I add an ImageView, how can I use the src attribute to locate the images in the drawable folder instead of mipmap?

I understand that I could put the images in the mipmap folder, but I would like to try and add images properly, so I need some help because I cannot see the images when I try and click the ... button in the ImageView src attribute when I am in design view. I tried doing this with in text view, but it still isn't working. Thanks in advance!

Georgi Koemdzhiev
Georgi Koemdzhiev
12,610 Points

Yeah, good question. I tried to add images manually to the drawable fonder using file explorer on Windows and when I went back to Android Studio the 4 folders with the different resolutions weren't there. I red online that we are supposed to put only the app icons in the mipmap folder and nothing else.

Thanks for asking me to help answer this but I know nothing about Mipmap, I'm afraid.

Sorry - hope you get it sorted.

Steve.

Hello,

Where exactly have you put your images(ie res/drawable-mdpi)? If you have them there, you should be able to reference them. Do you have your code on Github so that we can look at your directory structure? Otherwise, a screenshot might be enough to provide some more assistance.

Justin Mamaril
Justin Mamaril
3,895 Points

Here are some screenshots on Google Drive. I hope this helps in some way.

1 Answer

Hello,

You have the drawable-qualifier folders as a subfolder of drawable, they need to be at the same level as your drawable folder. Similar to how your mipmap directories are at the same level as the drawable folder.

Justin Mamaril
Justin Mamaril
3,895 Points

Yes! That worked! Thanks James.