@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Get UI controls mLblLatitudeValue = (TextView) findViewById(R.id.lblLatitudeValue); mLblLongitudeValue = (TextView) findViewById(R.id.lblLongitudeValue); mMapMain = (MapView) findViewById(R.id.mapMain); mMapMain.setBuiltInZoomControls(true); mMapOverlays = mMapMain.getOverlays(); mDrawable = this.getResources().getDrawable(R.drawable.androidmarker); mItemizedOverlay = new GeoItemizedOverlay(mDrawable, this); mMapOverlays.add(mItemizedOverlay); MyLocationOverlay myLocationOverlay = new MyLocationOverlay(this, mMapMain); mMapMain.getOverlays().add(myLocationOverlay); myLocationOverlay.enableMyLocation(); // Acquire a reference to the system Location Manager LocationManager locationManager = (LocationManager) this .getSystemService(Context.LOCATION_SERVICE);