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

Did Android Change How It Handles Drawable Folder?

It appears (to me anyway) that Android has substantially changed how it handles the drawable folder.

It doesn't appear to detect the suggested four subfolders or their contents and only works if image files are placed directly inside drawable, or possibly if the subfolders are placed directly under res at the same level that drawable formerly was placed, but not if they are nested under drawable.

3 Answers

Hie Robert make sure u ignore the default drawable folder inside the res.(Android Studio won't be able to pick your images since it does not recognise the file path) Just copy your all 4 drawable folders directly below the into the res folder. Surely that should work for you.

Yes, that does work.

Hie Mathew, android studio will only recognize image inside a a single drawable folder, ImageView iv = (ImageView)findViewById(v);
iv.setImageResource(R.drawable.image_name);

In other words after the drawable folder it will be searching for the image file and not another folder(not a folder drawable inside the other drawable)

Good to hear that it worked for you. Don't forget to mark the answer as Best Answer.

Matthew Francis
Matthew Francis
6,967 Points

Hi Jon, this is deifnitly helpful. But may I ask why andorid dosent reconize the filepath if you put it into the drawable folder?