Dynamic Itemized Overlay (GoogleMaps) in Android
<p>I'm trying to make an overlay which shows my location at every moment. I've tried a lot of codes but still cant get it.
This is my code:</p>

<pre><code>package com.pizzeria.uno;

import java.util.List;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;

public class ComoLlegar extends MapActivity {



@Override
protected void onCreate(Bundle icicle) {
    // TODO Auto-generated method stub
    super.onCreate(icicle);
    setContentView(R.layout.llegar);

    LocationManager locationManager;
    String context = Context.LOCATION_SERVICE;
    locationManager = (LocationManager)getSystemService(context);
    Criteria criteria = new Criteria();
    criteria.setAccuracy(Criteria.ACCURACY_FINE);
    criteria.setAltitudeRequired(false);
    criteria.setBearingRequired(false);
    criteria.setCostAllowed(true);
    criteria.setPowerRequirement(Criteria.POWER_LOW);
    String provider = locationManager.getBestProvider(criteria, true);
    Location location = locationManager.getLastKnownLocation(provider);

    updateWithNewLocation(location);
    locationManager.requestLocationUpdates(provider, 1000, 1,locationListener);
    MapView mapView = (MapView) findViewById(R.id.mapview);
    mapView.setBuiltInZoomControls(true);
    List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();
    Drawable drawable=this.getResources().getDrawable(R.drawable.ic_launcher);
    HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable, this);

    double lat =location.getLatitude();
    double lng=location.getLongitude();
    GeoPoint gp = new GeoPoint((int)(lat * 1E6), (int)(lng * 1E6));
    OverlayItem overlayitem = new OverlayItem(gp, "Hola, Mundo!", "I'm in Mexico City!");
    itemizedoverlay.addOverlay(overlayitem);
    mapOverlays.add(itemizedoverlay);}

    private final LocationListener locationListener = new LocationListener() {
    public void onLocationChanged(Location location) {
    updateWithNewLocation(location);}

    public void onProviderDisabled(String provider){
    updateWithNewLocation(null);}

    public void onProviderEnabled(String provider){}
    public void onStatusChanged(String provider, int status,Bundle extras){}
    };

    private void updateWithNewLocation(Location location) {



        if (location != null) {
        location.getLatitude();
        location.getLongitude();




// TODO Auto-generated method stub
        }
}

    @Override
    protected boolean isRouteDisplayed() {
        // TODO Auto-generated method stub
        return false;
    }

}
</code></pre>

<p>All what I get at the moment is my last known location. I would very pleased if someone could give me some help.</p>
