I am generating a string from database dynamically which has the same name of image in drawable folder.
drawable
Now I want to set that value for ImageView
ImageView
As simple as this answer:
Drawable myDrawable = getResources().getDrawable(R.drawable.pic); imageview.setImageDrawable(myDrawable);