I\'m new with android and java, so sorry if it\'s a too basic question but I\'ve tried to find a solution in the forums and google and I couldn\'t.
I have 24 buttons
It's a late answer but may useful someone looking out for a way to get the resource id (int) for any view / drawable / String programmatic.
image from res/drawable
int resID = getResources().getIdentifier("my_image",
"drawable", getPackageName());
view based on resource name
int resID = getResources().getIdentifier("my_resource",
"id", getPackageName());
string
int resID = getResources().getIdentifier("my_string",
"string", getPackageName());