java.util.ConcurrentModificationException
<p>//get the lat and loni throgh the loaddata function.java.util.ConcurrentModificationException  at java.util.AbstractList$SimpleListIterator.next(AbstractList.java:64) How to resolve it?Somebody said use Iterator.</p>

<pre><code>public void loaddata()
 {
     try
     {

            lat = new String[vechno.length];
            lon=new String[vechno.length];
            for(int i=0;i&lt;vechno.length;i++)
            {

                if(Integer.parseInt(vechspeed[i].trim())==0||vechspeed[i].trim()=="")
                {
                    latiloni=call2(vechno[i].toString());
                    lat[i]=latiloni[0];
                    lon[i]=latiloni[1];
                    GeoPoint point1 = new GeoPoint((int)(Double.parseDouble(lat[i])*1E6),(int)(Double.parseDouble(lon[i])*1E6));
                    OverlayItem overlayItem = new OverlayItem(point1,"Vehicle No : "+vechno[i]+"(Idle)", 
                            "Located           : "+vechloc[i]+"\n"+"Speed(kmph) : "+vechspeed[i]+"\n"+"Address           : "+vechadd[i]);
                    itemizedOverlay0.addOverlay(overlayItem);
                    final MapController mc = mapView.getController();
                    mc.animateTo(point1);
                    mc.setZoom(6);
                    mapOverlays.add(itemizedOverlay0);


                }
                else
                if(Integer.parseInt(vechspeed[i].trim())&gt;=1&amp;&amp;Integer.parseInt(vechspeed[i].trim())&lt;=20)
                {
                    latiloni=call2(vechno[i].toString());
                    lat[i]=latiloni[0];
                    lon[i]=latiloni[1];
                    GeoPoint point2 = new GeoPoint((int)(Double.parseDouble(lat[i])*1E6),(int)(Double.parseDouble(lon[i])*1E6));
                    OverlayItem overlayItem = new OverlayItem(point2,"Vehicle No : "+vechno[i]+"(Running)", 
                            "Located           : "+vechloc[i]+"\n"+"Speed(kmph) : "+vechspeed[i]+"\n"+"Address           : "+vechadd[i]);
                    itemizedOverlay1.addOverlay(overlayItem);
                    final MapController mc = mapView.getController();
                    mc.animateTo(point2);
                    mc.setZoom(6);
                    mapOverlays.add(itemizedOverlay1);

                }
                else
                if(Integer.parseInt(vechspeed[i].trim())&gt;=21&amp;&amp;Integer.parseInt(vechspeed[i].trim())&lt;=40)
                {
                        latiloni=call2(vechno[i].toString());
                        lat[i]=latiloni[0];
                        lon[i]=latiloni[1];
                        GeoPoint point3 = new GeoPoint((int)(Double.parseDouble(lat[i])*1E6),(int)(Double.parseDouble(lon[i])*1E6));
                        OverlayItem overlayItem = new OverlayItem(point3,"Vehicle No : "+vechno[i]+"(Running)", 
                                "Located           : "+vechloc[i]+"\n"+"Speed(kmph) : "+vechspeed[i]+"\n"+"Address           : "+vechadd[i]);
                        itemizedOverlay2.addOverlay(overlayItem);
                        final MapController mc = mapView.getController();
                        mc.animateTo(point3);
                        mc.setZoom(6);
                        mapOverlays.add(itemizedOverlay2);

                }
                else
                if(Integer.parseInt(vechspeed[i].trim())&gt;=41&amp;&amp;Integer.parseInt(vechspeed[i].trim())&lt;=60)
                {
                        latiloni=call2(vechno[i].toString());
                        lat[i]=latiloni[0];
                        lon[i]=latiloni[1];
                        GeoPoint point4 = new GeoPoint((int)(Double.parseDouble(lat[i])*1E6),(int)(Double.parseDouble(lon[i])*1E6));
                        OverlayItem overlayItem = new OverlayItem(point4,"Vehicle No : "+vechno[i]+"(Running)", 
                                "Located           : "+vechloc[i]+"\n"+"Speed(kmph) : "+vechspeed[i]+"\n"+"Address           : "+vechadd[i]);
                        itemizedOverlay3.addOverlay(overlayItem);
                        final MapController mc = mapView.getController();
                        mc.animateTo(point4);
                        mc.setZoom(6);
                        mapOverlays.add(itemizedOverlay3);

                }
                else
                if(Integer.parseInt(vechspeed[i].trim())&gt;=61&amp;&amp;Integer.parseInt(vechspeed[i].trim())&lt;=80)
                {
                        latiloni=call2(vechno[i].toString());
                        lat[i]=latiloni[0];
                        lon[i]=latiloni[1];
                        GeoPoint point5 = new GeoPoint((int)(Double.parseDouble(lat[i])*1E6),(int)(Double.parseDouble(lon[i])*1E6));
                        OverlayItem overlayItem = new OverlayItem(point5,"Vehicle No : "+vechno[i]+"(Running)", 
                                "Located           : "+vechloc[i]+"\n"+"Speed(kmph) : "+vechspeed[i]+"\n"+"Address           : "+vechadd[i]);
                        itemizedOverlay4.addOverlay(overlayItem);
                        final MapController mc = mapView.getController();
                        mc.animateTo(point5);
                        mc.setZoom(6);
                        mapOverlays.add(itemizedOverlay4);

                }
                else
                if(Integer.parseInt(vechspeed[i].trim())&gt;=81&amp;&amp;Integer.parseInt(vechspeed[i].trim())&lt;=120)
                {

                        latiloni=call2(vechno[i].toString());
                        lat[i]=latiloni[0];
                        lon[i]=latiloni[1];
                        GeoPoint point6 = new GeoPoint((int)(Double.parseDouble(lat[i])*1E6),(int)(Double.parseDouble(lon[i])*1E6));
                        OverlayItem overlayItem6 = new OverlayItem(point6,"Vehicle No : "+vechno[i]+"(Running)", 
                                "Located           : "+vechloc[i]+"\n"+"Speed(kmph) : "+vechspeed[i]+"\n"+"Address           : "+vechadd[i]);
                        itemizedOverlay5.addOverlay(overlayItem6);
                        final MapController mc = mapView.getController();
                        mc.animateTo(point6);
                        mc.setZoom(6);
                        mapOverlays.add(itemizedOverlay5);

                }
                else
                if(Integer.parseInt(vechspeed[i].trim())&gt;=120&amp;&amp;Integer.parseInt(vechspeed[i].trim())&lt;=150)
                {
                        latiloni=call2(vechno[i].toString());
                        lat[i]=latiloni[0];
                        lon[i]=latiloni[1];
                        GeoPoint point7 = new GeoPoint((int)(Double.parseDouble(lat[i])*1E6),(int)(Double.parseDouble(lon[i])*1E6));
                        OverlayItem overlayItem = new OverlayItem(point7,"Vehicle No : "+vechno[i]+"(Running)", 
                                "Located           : "+vechloc[i]+"\n"+"Speed(kmph) : "+vechspeed[i]+"\n"+"Address           : "+vechadd[i]);
                        itemizedOverlay6.addOverlay(overlayItem);
                        final MapController mc = mapView.getController();
                        mc.animateTo(point7);
                        mc.setZoom(6);
                        mapOverlays.add(itemizedOverlay6);

                }   

            }
            mapView.invalidate();
     }
     catch(Exception e)
     {

     }

 }
 protected void dosomthing()
 {
        progressdialog1=ProgressDialog.show(Mapping.this, "", "Loading.Please wait...");
        Runnable threadTask = new Runnable() {

            @Override
            public void run() {

                while(true){
                    try {
                        Thread.sleep(2000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    loaddata();
                    messageHandler.sendEmptyMessage(0);

                }
            }
        };
        (new Thread(threadTask)).start();
 }
</code></pre>
