AndroidDev
AndroidDev

Reputation: 4559

Create folder in drawable

Is it possible to create our own folder in drawable and put all my images in that folder as:

"drawable\Myimages\p.png.."

If it possible than how can i use this images in my activity..gnerally we use "R.drawablw.p" but now how that can be written because now my images is in drawable\Myimages directory

please suggest me..

with regards Anshuman

Upvotes: 7

Views: 11131

Answers (2)

Andrei Buneyeu
Andrei Buneyeu

Reputation: 6680

No, you can't create your own file hierarchy in drawable directory.

But you can see in http://developer.android.com/guide/topics/resources/providing-resources.html:

However, if you need access to original file names and file hierarchy, you might consider saving some resources in the assets/ directory (instead of res/raw/). Files in assets/ are not given a resource ID, so you can read them only using AssetManager.

If you have very many resources, it can be useful for you.

Upvotes: 10

Uttam
Uttam

Reputation: 12399

No, the resources mechanism doesn't support subfolders in the drawable directory.You can't used.

Upvotes: 6

Related Questions