this is my code..
for (int i = 0; i < 12; i++)
{
buttons[i] = (Button)findViewById(R.id.buttonid);
@Override
public void onClick(View v) {
// in this method I want to set the button text to the iteration variable 'i'
}
});
}
my need is to get the iteration variable inside the onclick method. I tried by assigning the i value to another int variable(with and without using final) before the onclick method. But all this shows some errors.
Thanks in advance.