set image drawable from string android studio code example
Example: setimagedrawable in android
int id = getResources().getIdentifier("yourpackagename:drawable/" + StringGenerated, null, null);
int id = getResources().getIdentifier("yourpackagename:drawable/" + StringGenerated, null, null);