title: Get user current position with gps/network android MapView
body: <p>Hello I've been using this guide to determine the locationof the user: <a href="http://developer.android.com/guide/topics/location/obtaining-user-location.html" rel="nofollow noreferrer">http://developer.android.com/guide/topics/location/obtaining-user-location.html</a></p>
  
  <p>and my current code looks like this:</p>
  
  <pre><code>    LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
  
      LocationListener locationListener = new LocationListener() {
          public void onLocationChanged(Location location) {
              test = new GeoPoint((int)location.getLatitude()*1000000, (int)location.getAltitude()*1000000);
              mapController.animateTo(test);
          }
  
          @Override
          public void onProviderDisabled(String provider) {
              // TODO Auto-generated method stub
  
          }
          @Override
          public void onProviderEnabled(String provider) {
              // TODO Auto-generated method stub
  
          }
          @Override
          public void onStatusChanged(String provider, int status, Bundle extras) {
              // TODO Auto-generated method stub
  
          }
      };
      locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);
  }
  </code></pre>
  
  <p>I only get error and the app shuts down though when I'm using this activity.</p>
  
  <p>Thankful for help</p>