Add a new "Android Resource Directory" in the project [duplicate]

1

Hello, I'm just starting to work with Android Studio. Well, I have a collection of images that I will use in my app and these images are separated into 3 folders. When I create a new directory in the folder of my project, and I put the images, I can not get the identifier of these images.

this.img_atividade.setImageResource ( getResources().getIdentifier(this.name.toLowerCase () , "atividade", getPackageName()) );

In this example, I'm looking for the image id "this.name" that is inside the "activity" directory ... But it does not work, however if I replace "activity" with "drawable" and the image I want to fetch there in the drawable, it works very well.

I have already looked a lot about it, so I have to be able to reference this in the R Class, but I have doubts as to that.

Thank you!

    
asked by anonymous 23.08.2018 / 14:45

1 answer

1

I believe you can not put a folder with a name other than the default name within res .

What you can do is put these images inside assets , there you are free to rename the folder however you want.

    
23.08.2018 / 15:18