Drawing a path on map using gps location but its draw both marker i want to draw only start marker and path?
<p>plz help me out to resolve this issue...m new in android</p>

<p>i paste my code here.plz notify me where m wrong in this code.
where m drawing two marker instead of one marker an path.</p>

<p>public class GoogleActivity extends MapActivity implements LocationListener {</p>

<pre><code> private LocationManager myLocationManager;
 private LocationListener myLocationListener;
 private TextView myLongitude, myLatitude;
 private MapView myMapView;
 private MapController myMapController;
 LinearLayout zoomLayout;
 GeoPoint myLastPosition;
 AddItemizedOverlay mapOvlay;

 private void CenterLocatio(GeoPoint centerGeoPoint)
 {
  myMapController.animateTo(centerGeoPoint);

  List&lt;Overlay&gt; mapOverlays = myMapView.getOverlays();
  Drawable drawable = this.getResources().getDrawable(R.drawable.mark_red);

  if(myLastPosition != null){
  mapOvlay = new AddItemizedOverlay(myLastPosition ,centerGeoPoint,drawable );
  OverlayItem overlayitem = new OverlayItem(centerGeoPoint,"","" );
  mapOvlay.addOverlay(overlayitem);
  mapOverlays.add(mapOvlay);
  }


     myLastPosition = centerGeoPoint;

};

 /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);

  myMapView = (MapView)findViewById(R.id.mapView);
  myMapView.setBuiltInZoomControls(true);

         myLastPosition = null;
     myMapController = myMapView.getController();
     myMapController.setZoom(12); //Fixed Zoom Level
     myMapView.invalidate();

  myLocationManager = (LocationManager)getSystemService(
    Context.LOCATION_SERVICE);

  myLocationListener = new MyLocationListener();

  myLocationManager.requestLocationUpdates(
    LocationManager.GPS_PROVIDER,
    0,
    0,
    myLocationListener);



 }
 class MyLocationListener implements LocationListener{

      public void onLocationChanged(Location argLocation) {
        GeoPoint myGeoPoint = new GeoPoint(
        (int)(argLocation.getLatitude()*1000000),
         (int)(argLocation.getLongitude()*1000000));

     GeoPoint newGeoPoint = new  GeoPoint(myGeoPoint.getLatitudeE6() ,myGeoPoint.getLongitudeE6());
   CenterLocatio(newGeoPoint);


  }

  public void onProviderDisabled(String provider) {
      Toast.makeText(getBaseContext(),"GPS Disabled" ,Toast.LENGTH_SHORT).show();
  }

  public void onProviderEnabled(String provider) {
      Toast.makeText(getBaseContext(),"GPS Enabled" ,Toast.LENGTH_SHORT).show();
  }

  public void onStatusChanged(String provider,
    int status, Bundle extras) {
      Toast.makeText(getBaseContext(),"GPS Unavailable" ,Toast.LENGTH_SHORT).show();
  }
 }

 public void stopUsingGPS(){
        if(myLocationManager != null){
            myLocationManager.removeUpdates(GoogleMapLocationActivity.this);
        }       
 }

 @Override
 protected boolean isRouteDisplayed() {
  return false;
 }

@Override
public void onLocationChanged(Location arg0) {
    // TODO Auto-generated method stub

}

@Override
public void onProviderDisabled(String arg0) {
    // TODO Auto-generated method stub

}

@Override
public void onProviderEnabled(String arg0) {
    // TODO Auto-generated method stub

}

@Override
public void onStatusChanged(String arg0, int arg1, Bundle arg2) {
    // TODO Auto-generated method stub

};

@Override
public boolean onKeyDown(int keyCode, KeyEvent event)  {
    if (keyCode == KeyEvent.KEYCODE_BACK &amp;&amp; event.getRepeatCount() == 0) {
        // do something on back.
       this.finish();
        return true;
    }
enter code here
    return super.onKeyDown(keyCode, event);
}
}
</code></pre>
