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 trialrobert morea
7,599 PointsDid 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
Jonathan Nyakunhuwa
5,810 PointsHie 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.
Jonathan Nyakunhuwa
5,810 PointsHie 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)
Jonathan Nyakunhuwa
5,810 PointsGood to hear that it worked for you. Don't forget to mark the answer as Best Answer.
Matthew Francis
6,967 PointsHi Jon, this is deifnitly helpful. But may I ask why andorid dosent reconize the filepath if you put it into the drawable folder?
robert morea
7,599 Pointsrobert morea
7,599 PointsYes, that does work.