Hey there. My app is going to be using an array of 64 ImageButtons (8x8), and they\'re all already declared in my XML Layout with names like one1, two5, eight8, etc. Rather than
If you didn't already hardcode the buttons in the xml, I would have said to do it programmatically with a ViewInflater, but since you did here's the code:
String[] number_as_word = ["one", "two", "three", "four", "five", "six", "seven", "eight"];
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
musicGrid[i][j] = (ImageButton) findViewById("R.id." + number_as_word[i] + (j+1));
}
}