User location not found :- latitude and longitude in android
<p>My code putput always goes in else part. IT means {location} is null.</p>

<p>Any suggestions?</p>

<pre><code>locManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
locManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0, locationListener);  
location = locManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);

            if(location != null)                                
            {
        double latitude = location.getLatitude();
        double longitude = location.getLongitude();

            }  else {
                // 
            }
.....
.....
....
</code></pre>
