I want to change the image resource for bitmap dynamically. But I can’t call them with name from the drawable class.
bmp = BitmapFactory.decodeResource(getResources(), R.drawable.getImage(foldername + "/" + imagename));
I need to do something like that but I couldn’t find the proper way of doing this.,
EDITED
I think I should be more clear. I store my images under the drawable folder and they are separeted into other folders.
For example;
drawable/imageset1, drawable/imageset2,
and I want to change the Image resource for bitmap depending on user input.
For example:
User selects imageset5 from first spinner, and selects image5.png from another spinner.
I hope this will do what you want
EDITED:
while the above code will work only if you follow android rule which doesn’t allow sub directories in drawable folder so the above code will work only when directly accessing images from drawable.
As these links describe
How to access res/drawable/"folder"
Can the Android drawable directory contain subdirectories?