ConcurrentModificationException on removing Overlay from MapView's overlayList
<p>I'm trying to search for a custom ItemizedOverlay that contains certain data...
I keep getting a ConcurrentModificationException on the for-loop when i'm trying to run through all the overlays of my MapView.</p>

<p>I hope somebody knows the answer to this problem...</p>

<p>here's the code:</p>

<pre><code>    @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {

    super.onActivityResult(requestCode, resultCode, data);
    Log.d("Activityresult", "voor ok");
    if(resultCode == RESULT_OK){
        GeoPoint point = new GeoPoint(touchedPoint.getLatitudeE6(), touchedPoint.getLongitudeE6());
        Car car = data.getExtras().getParcelable("car");
        PinpointItem pinpoint = new PinpointItem(point, car, DropHostCarActivity.this);
        CustomPinpointOverlay custom = new CustomPinpointOverlay(d, DropHostCarActivity.this);
        custom.insertPinpoint(pinpoint);
        List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();
        if (mapOverlays.size() &gt; 1) {
            removeSameCar(mapOverlays,car);
        }
        overlayList.add(custom);
        mapView.invalidate();
    }
}

private void removeSameCar(List&lt;Overlay&gt; mapOverlays, Car car) {
    for(Overlay overlay: mapOverlays){
        if(overlay instanceof CustomPinpointOverlay &amp;&amp; 
                ((CustomPinpointOverlay) overlay).getItem(0).getCar().getNumberPlate().equals(car.getNumberPlate())){
            overlayList.remove(overlay);
        }
    }

}
</code></pre>
