I have a list of entries and some bitmap files in the res/drawable-mdpi directory. I\'m trying to load the image corresponding to the string value selected from the list by
No need to use getDrawable() you directly use the resource id like
String mDrawableName = "myimageName"; int resID = res.getIdentifier(mDrawableName , "drawable", getPackageName()); imgView.setImageResource(resID);