Closed GoogleCodeExporter closed 8 years ago
The problem is that it calculates the size at line 112 and then loops, but in
the meantime the size has changed.
It would probably be better to use an iterator and quit on
ConcurrentModificationException.
Alternatively you could use .size() directly in the for loop, but it in that
case it would still be using an index that doesn't quite make sense any more.
When you say "synchronizing all those methods" do you mean adding a
synchronized keyword to the method declaration, or do you mean a synchronized
block?
From what I hear from people cleverer than me is that you should avoid the Java
native implementations like synchronized because Android has better
implementations.
Original comment by neilboyd
on 24 Aug 2012 at 11:25
I ment adding a synchronized block but now that you say it, I think your
proposed solution with the synchronize keyword on method declaration is cleaner.
I didn't know of this synchronisation mechanism in Android, I will investigate
on it.
Original comment by laurentg...@gmail.com
on 28 Aug 2012 at 10:19
you can also use an asyncpost by doing like this
do on the doinbackground the :
mapView.getOverlays().add(mapPoints);
and in the onPostexecute :
this.mapPoints.addItem(myOverlayItem);
Original comment by tamisier...@gmail.com
on 13 Dec 2012 at 10:13
This problem is not osmdroid related and appears to be fixed anyway.
Original comment by kurtzm...@gmail.com
on 5 Mar 2013 at 6:19
I am still getting this issue regularly. Exactly same procedure to reproduce it
as Laurent.
Original comment by eenriquelopez@gmail.com
on 2 Sep 2013 at 12:00
Original issue reported on code.google.com by
laurentg...@gmail.com
on 24 Aug 2012 at 8:00