I have a problem with a for loop.
this is my code
int i;
int from= Integer.valueOf(field_from.getText().toString());
int to = Integer.valueOf(field_to.getText().toString());
Log.d("wec", "from->"+from+" to->"+to);
for(i=from; from < to; i++){
Log.d("wec", "i->"+i);
}
The value of field_from is 1 and the value of field_to is 10
When i run the script the application be crazy because start a loop from 100 to infinite
Anyone know why?
your comparison logic is wrong in for loop
instead of ( from < to)
you should have (i < to) in for loop