title: LocationManager doesn't update a location
body: <p>There is the following code for getting current location:</p>
  
  <pre><code>final LocationManager manager=(LocationManager)getSystemService(Context.LOCATION_SERVICE);
  LocationListener listener=new LocationListener() {
  
      @Override
      public void onLocationChanged(Location location) {
  
          manager.removeUpdates(this);
          Toast.makeText(MainActivity.this, "2", Toast.LENGTH_LONG).show();
          if (location!=null) {
                                  doSomeAction();
          }
          else {
              Toast.makeText(MainActivity.this, LOCATION_IS_NULL_MESSAGE, Toast.LENGTH_LONG).show();
          }
      }
  
      @Override
      public void onProviderDisabled(String provider) {
          manager.removeUpdates(this);
          String newProvider=provider.equals(LocationManager.GPS_PROVIDER) ? LocationManager.NETWORK_PROVIDER : null; 
          if (newProvider==null) {
              Toast.makeText(MainActivity.this, LOCATION_PROVIDERS_ARE_DISABLED_MESSAGE, Toast.LENGTH_LONG).show();
          }
          else {
              manager.requestLocationUpdates(newProvider, 0, 0, this);
          }
      }
  
      @Override
      public void onProviderEnabled(String provider) {}
  
      @Override
      public void onStatusChanged(String provider, int status,
              Bundle extras) {}
  
  };
  String provider=manager.isProviderEnabled(LocationManager.GPS_PROVIDER) ? LocationManager.GPS_PROVIDER : 
      LocationManager.NETWORK_PROVIDER;
  Location location=manager.getLastKnownLocation(provider);
  if (location!=null) {
                  doSomeAction();
  }
  else {
      Toast.makeText(this, "1", Toast.LENGTH_LONG).show();
      manager.requestLocationUpdates(provider, 0, 0, listener);
  }
  </code></pre>
  
  <p>I see toast "1" each time, but I've never seen "2" toast, therefore my location isn't be updated. Please, tell me, I need to get my current location - how can I fix my problem? I use network location provider.</p>