I want to iterate through a bunch of buttons which are in XML, so I gave each of them an id consisting of a letter and unique number (like q1, q2, q3, etc.).
Now in MainActivity I want to write a for loop that accesses each button by incrementing the id's number:
for (int i = 0; i <10; i++){
String buttonId = "q" + i;
findViewById(R.id.buttonId);
}
Java obviously doesn't allow this, so I'm hoping there are some neat alternatives to doing this.