Getting location on first boot FC also and random FC's on some devices
<p>I am getting the current location with the following code but this is causing FC if there is no last known location. Also some devices like Motorola atrix crash if they open this activity.</p>

<pre><code>locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
        locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000L, 500.0f, this);
        locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000L, 500.0f, this);
        Location location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);

        double lat = location.getLatitude();
        double lng = location.getLongitude();
</code></pre>

<p>Is there a better way of getting the current location with out crashing my app?</p>
