title: GPS provider enabled but getLastKnownLocation(provider) returns null
body: <p>I'm trying to use a GPS Provider for my app.</p>
  
  <p>The app finds the device’s current location, using the GPS Location Provider.</p>
  
  <p>The app works just fine. But, although my GPS_Provider is enabled, <code>geLastKnownLocation()</code> returns null.</p>
  
  <p><strong>MainActivity.java</strong></p>
  
  <hr>
  
  <pre><code>public class MainActivity extends Activity {
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          LocationManager locationManager;
          String context = Context.LOCATION_SERVICE;
          locationManager = (LocationManager)getSystemService(context);
  
          String provider = LocationManager.GPS_PROVIDER;
          Location location = locationManager.getLastKnownLocation(provider);
  
          Log.v("BEFORE", "Location is: " + location);
          updateWithNewLocation(location);
          Log.v("AFTER", "LOCATION FOUND");
      }
  
      private void updateWithNewLocation(Location location){
          String latLongString;
          TextView myLocationText;
          myLocationText = (TextView)findViewById(R.id.myLocationText);
  
          if (location != null) {
              double lat = location.getLatitude();
              double lng = location.getLongitude();
              latLongString = "Lat:" + lat + "\nLong:" + lng;
          } 
          else {
              latLongString = "No location found";
          }
  
          myLocationText.setText("Your Current Position is:\n" + latLongString);
      }
  
  }
  </code></pre>
  
  <p><strong>Manifest.xml</strong></p>
  
  <hr>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.paad.whereami"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="4"
      android:targetSdkVersion="15" /&gt;
  
      &lt;application
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name=".MainActivity"
              android:label="@string/title_activity_main" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
      &lt;uses-permission
          android:name="android.permission.ACCESS_FINE_LOCATION"
      /&gt;
  
  &lt;/manifest&gt;
  </code></pre>