for example:
for (int i = 0; i < 10; i++){
SomeClass something = new SomeClass();
something.setOnClickListener(new OnClickListener() {
public void onClick(){
doSomething(i);
}
});
}
I am not allowed to use the variable i
, Eclipse suggest me make the i
final
, but I cannot do that because I need it to iterate right?