Setting Android images from string value

There is a method for doing that, you can retreive resource IDs by string using Resources.getIdentifier() http://developer.android.com/reference/android/content/res/Resources.html

Something like:

int resourceId = Activity.getResources().getIdentifier("testimage", "drawable", "your.package.name");

Leave a Comment