for (int i=1; i<n; i ++)
{
someButton.setOnclickListener(new View.OnClickListener{
@Override
public void onClick( View...){
otherMethod(i); //Note this is inside actionListener and not just the for loop
}
});
}
I thought this should not work because we usually call the methode while the for loop is running, but on click event my be after two hours! in fact, this code works, but where the i
is stored temporarily? As a static param?
Please help me understand this.