I have sixteen image buttons, so I create an array of Image Buttons. I would like to initialize them with a for loop, I would not like to do that one by one, though I do not know if it is possible. For one imagebutton, it would be something, like this:
imgbtn[0] = (ImageButton)findViewById(R.id.imgButton1);
I see that the R.id.smth part is an integer. Does it say somewhere, where does that integer value start for imgButtons? So that I could so something like this:
int value = R.id.imgButton1;
for(int i = 0; i < imgbtn.length; i++)
{
imgbtn[i] = (ImageButton)findViewById(value);
value++; //or something along these lines
}