Code:
for(int i = 0; i<9;i++) {
b[i].setOnClickListener(
new OnClickListener()
{
public void onClick(View v)
{
justclicked(i);
}
}
);
}
I am attempting to put an action listener on nine buttons using a for loop. The code above is giving me an error. Is the error caused by the value of i not being visible in justclicked(i)?? Thanks a lot, world-class experts @ Linux Questions!!