adding path overlay using a timer task caught ConcurrentModificationException on zooming
<p>I want to draw straight line path between many  geopoints as the code given ..... but if I try to zoomin the map ConcurrentModificationException occurred, 
plz help me.... i am very new for android.....</p>

<pre><code>//this is the methode to draw path
 public void draw_path(View view) {
     if(timer!=null)
         timer.cancel();

      timerpath = new Timer();
      timerpath.scheduleAtFixedRate(new TimerTask(){
          int i=0;
        @Override
        public void run() {
            // TODO Auto-generated method stub
             List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();

             if(i&lt;replaydata.length-2){
                 GeoPoint point=new GeoPoint((int) (Float.parseFloat(replaydata[i].split("~")[0]) * 1E6),(int) (Float.parseFloat(replaydata[i].split("~")[1])* 1E6));
                 GeoPoint point2=new GeoPoint((int) (Float.parseFloat(replaydata[i+1].split("~")[0]) * 1E6),(int) (Float.parseFloat(replaydata[i+1].split("~")[1])* 1E6));

                 mapOverlays.add(new PathOverlay(point2, point));
                 mapView.postInvalidate();
                 i=i+1;
             }
             }


        }, 50, 500);

    }
//this is the PathOverlay Class
package com.suneeltectonics.tracking;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.Projection;
public class PathOverlay extends Overlay {
private GeoPoint gp1;
private GeoPoint gp2;

public PathOverlay(GeoPoint gp1, GeoPoint gp2) {
    this.gp1 = gp1;
    this.gp2 = gp2;
}

@Override
public boolean draw(Canvas canvas, MapView mapView, boolean shadow,
        long when) {
    // TODO Auto-generated method stub
    Projection projection = mapView.getProjection();
    if (shadow == false) {

        Paint paint = new Paint();
        paint.setAntiAlias(true);
        Point point = new Point();
        projection.toPixels(gp1, point);
        paint.setColor(Color.RED);
        Point point2 = new Point();
        projection.toPixels(gp2, point2);
        paint.setStrokeWidth(6);
        canvas.drawLine((float) point.x, (float) point.y, (float) point2.x,
                (float) point2.y, paint);
    }
    return super.draw(canvas, mapView, shadow, when);
}

@Override
public void draw(Canvas canvas, MapView mapView, boolean shadow) {
    // TODO Auto-generated method stub

    super.draw(canvas, mapView, shadow);
}

}
 //this is the crash log
 07-26 17:42:30.850: WARN/dalvikvm(2173): threadid=1: thread exiting with uncaught exception (group=0x400207d8)
 07-26 17:42:30.870: ERROR/AndroidRuntime(2173): FATAL EXCEPTION: main
 07-26 17:42:30.870: ERROR/AndroidRuntime(2173): java.util.ConcurrentModificationException
07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:573)
 07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:44)
07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at com.google.android.maps.MapView.onDraw(MapView.java:494)
07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.view.View.draw(View.java:6740)
07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.view.View.draw(View.java:6743)
07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
</code></pre>

<p>07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
    07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
    07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.view.View.draw(View.java:6743)
    07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
    07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1842)
    07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.view.ViewRoot.draw(ViewRoot.java:1407)
    07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1163)
    07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)
    07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.os.Handler.dispatchMessage(Handler.java:99)
    07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.os.Looper.loop(Looper.java:123)
    07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at android.app.ActivityThread.main(ActivityThread.java:4633)
    07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at java.lang.reflect.Method.invokeNative(Native Method)
    07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at java.lang.reflect.Method.invoke(Method.java:521)
    07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:891)
    07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:649)
    07-26 17:42:30.870: ERROR/AndroidRuntime(2173):     at dalvik.system.NativeStart.main(Native Method)
    07-26 17:42:30.920: WARN/ActivityManager(150):   Force finishing activity       com.suneeltectonics.tracking/.ViewReplay</p>
