How to get CurrentLocation from GPS FirstTime quickly?
<p>Iam using </p>

<pre><code>locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
String bestProvider = locationManager.getBestProvider(criteria, true);
locationManager.requestLocationUpdates(bestProvider, 0, 0, this);
location = locationManager.getLastKnownLocation(bestProvider);
</code></pre>

<p>but first time it is not giving location object.Always giving me null.I read in developer.android.com ,</p>

<blockquote>
  <p>"Cached Location is dismissed if it is
  too old"</p>
</blockquote>

<p>But second time it is giving location updates.How to solve my problem.</p>

<p>Regards,
Android Developer</p>
