title: LocationManager returns old cached "Wifi" location with current timestamp
body: <p>I am trying to get the current location. For that I implement a LocationListener and register it for both the network and the GPS provider:</p>
  
  <pre><code>locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
  locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);
  </code></pre>
  
  <p>I block then for 30 seconds and use the first location that gets passed into the listener's </p>
  
  <pre><code>onLocationChanged()
  </code></pre>
  
  <p>method with an accuracy of 100 meters or better.</p>
  
  <p>Most of the time this works fine. If the phone is connected to some Wifi network, it takes just a second to get a correct location with an accuracy of about 50 meters. If there is no Wifi but GPS is enabled, it can of course take a while to get a location.</p>
  
  <p>Sometimes however, when connected to a Wifi and getting the current location, some old (cached?) previous "Wifi" location is provided - it might be 15 minutes old and 15 kilometers away from the current location.
  The problem is, that </p>
  
  <pre><code>location.getTime()
  </code></pre>
  
  <p>returns the current time - so it is impossible to know that the location is old.</p>
  
  <p>I guess I have to implement a more elaborate solution - I would just like to know why these old "Wifi" locations have a current timestamp instead one from the time when it was originally retrieved.</p>