¿Asir la ubicación del usuario con google maps v2 en android?

Quiero colocar un marcador en el mapa cada vez que cambie la ubicación. Estoy agarrando Lat y Long desde la Location y crear un marcador dentro del método onLocationChanged() . ¿Por qué no se crea el marcador?

  public class MainActivity extends FragmentActivity implements LocationListener { Context context = this; GoogleMap googlemap; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); initMap(); addTwittertoMap(); LocationManager lm = (LocationManager) getSystemService(LOCATION_SERVICE); lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 10000, 0, this); String provider = lm.getBestProvider(new Criteria(), true); } public void onLocationChanged(Location location) { LatLng current = new LatLng(location.getLatitude(), location.getLatitude()); Date date = new Date(); googlemap.addMarker(new MarkerOptions() .title("Current Pos") .snippet(new Timestamp(date.getTime()).toString()) .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE)) .position(current) ); } public void onStatusChanged(String provider, int status, Bundle extras) { } public void onProviderEnabled(String provider) { } public void onProviderDisabled(String provider) { } private void initMap(){ SupportMapFragment mf = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); googlemap = mf.getMap(); googlemap.setMyLocationEnabled(true); googlemap.setMapType(GoogleMap.MAP_TYPE_NORMAL); } 

LatLng current = new LatLng(location.getLatitude(), location.getLatitude()); Debe ser LatLng current = new LatLng(location.getLatitude(), location.getLongitude());

Además, como una mejora en la configuración de LocationManager, sugeriría configurarlo de esta manera:

  LocationManager lm = (LocationManager) getSystemService(LOCATION_SERVICE); String provider = lm.getBestProvider(new Criteria(), true); lm.requestLocationUpdates(provider, 10000, 0, this); 
  • Android Google Maps V2 - Tarjeta Sd como proveedor de mosaico
  • Cómo encontrar el nivel de zoom basado en círculo dibujar en el mapa
  • Error de compilación en Android Studio Al realizar un simple proyecto Google API de Google Maps API v2
  • Google map android api v2 falla en la aplicación
  • Marcador de ubicación actual de Google Maps y superposición de radio de precisión
  • Abrir Google Maps desde hipervínculo
  • android.view.inflateexception binario archivo xml línea # 6 error o inflar fragmento de clase
  • Google Map no aparece en Android
  • Android Google Maps: Combine scrollBy con zoomBy para pan y zoom simultáneos
  • Cómo ampliar y agregar marcador a android mapfragment
  • Error en el comando Keytool
  • FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.