I’m trying to run a specific code that regularly adds/removes markers on a map, I tried the AsyncTask approach instead of thread and runnable,
in the doInBackground :
mapView.getOverlays.remove()
mapView.getOverlays.addOverlay(new overlay)
mapView.getController.animate(center point)
actual problem is, that code runs continuously and while executing map gets rendering and tries to get overlays to draw, while the code is removing and adding into the list, so ConcurrentModificationException is thrown and the application halts
I need help about it, I feel that I’m on the wrong path, what really should I use when trying to run code in background thread that updates regularly markers on the map ??
If you do not want to render the points all in one go like slkorolev suggested, use the UI handler mechanism.