Reputation: 5031
I have looked everywhere but cannot find an example of programmatically setting a background resource from a string value?
As an example:
Drawable a = getResources().getDrawable( R.drawable.a );
Drawable b = getResources().getDrawable( R.drawable.b );
Drawable c = getResources().getDrawable( R.drawable.c );
abc.setBackgroundResource("b");
Is this possible or would I have to do it as a big switch statement?
Upvotes: 1
Views: 2664