I want to set an ImageView programatically, passing the name of the local resource drawable as String.
The drawable clearly are int identified in this way
R.drawable.mydrawable_name
How could I do to solve this problem without map everything in a conditional switch?
I want to avoid something in this form
if(myString.equal"stringname_1"){
myImageview.setImageResource( R.drawable.stringname_1);
}
else if(myString.equal"stringname_1")....
etc