This is very strange. I have this snippet of code that is being executed in android:
private int doStuff(String assignment, List<String> assignments) {
int iterations = 0;
for (int i = 0; i < assignments.size(); i++) {
iterations++;
if (assignments.get(i) != assignment) {
return i;
}
}
Log.d(TAG,String.valueOf("Iterated "+ iterations +" over list with size "+assignments.size()));
return 0;
}
Nothing comes out from the logging. I have here a link to a video where I am debugging though the steps. The size of the list is 3 but it stops after 1 iteration. I have run clean. I have run adb uninstall. I have restarted the computer. I don't get it, why does this stop looping in the first iteration?
Note: I reach the last line of the method. I never reach "return i;". Even if string comparison is bad then it shouldn't reach the last row of the method in the way it does on the video.