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
You can Create Common Function for getting image drawable like this:
public static Drawable getDrawable(Context mContext, String name) { int resourceId = mContext.getResources().getIdentifier(name, "drawable", mContext.getPackageName()); return mContext.getResources().getDrawable(resourceId); }