简体   繁体   中英

How to create a new folder inside the drawable folder and reference an image from it?

I am working on an ANDROID project where I have a lot of images and I want to organize it. So I need to create folder inside the drawable folder. But I don't know how to reference it in my program.

For eg: I have an image named "image.png" and I want to place it in drawable/myicons/image.png or anywhere inside the res folder.

This is duplicate question

You can not create folder inside drawable

the resources mechanism doesn't support subfolders in the drawable directory

However you can use the assets folder and have sub directories in there and load images that way.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM