I have some Images in my project. The name of the image is stored in a String and I would like to setImageResource(R.drawable.\".....\"); with the string of the image name but t
I got it working by moving the image from 'drawable' to 'raw' folder and access the string value as below. If you do not have 'raw' folder under 'res' directory, right click on res->new->Android resource directory and under dropdown of resourcetype, select 'raw'.
String avatar = ("android.resource://" + "yourPackageName/" + String.valueOf(R.raw.robot_blue));