1
Hello, I’m just getting 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 res folder of my project, and place the images, I’m not getting the handle 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 directory "activity"... But it doesn’t work, but if I replace "activity" with "drawable" and the image I want to look for there in drawable, it works very well.
I’ve looked around a lot, so I need to be able to reference that in R-Class, but I have doubts in the meantime.
Thank you!
I don’t think you can create a folder with a different name than the default one within
res
. You can put these images inside theassets
.– LMaker
I did what you said and it worked. Thank you!
– Rafael Araujo
Cool, I’ll put it as an answer so I can mark it as correct.
– LMaker