I am new to java programming, been programing in php so I\'m used to this type of loop:
int size = mapOverlays.size();
for(int n=1;n
An ArrayList
has integer indices from 0 to size() - 1
. You could do:
int size = mapOverlays.size();
for(int n=1;n
This probably matches what you expect from PHP. It works by continually removing the 1th element, which changes. However, this has poor performance, since the internal array must constantly be shifted down. It is better to use clear()
or go in reverse order.
It's too bad removeRange is protected, as that would be convenient for this type of operation.