I'm very new to Java. So pardon me for asking such simple question.
To set the background-image of a view, I can do that by
int TheButton = R.drawable.button1;
button.setBackgroundResource(TheButton);
But how can this be done if I want to use a variable to specify the R object?
int a = 1;
int TheButton = R.drawable["button"+a]; //this is what I'll do in javascript...
button.setBackgroundResource(TheButton);