title: getLastKnownLocation returning NULL
body: <p>I had just got this to work but when I turned off my Wifi to see if I could get a more accurate location using my GPS it's now bringing me a <code>NullPointer</code> error and I can't see why.</p>
  
  <p>The below code gets called first;</p>
  
  <pre><code> public void onConnected(Bundle dataBundle) {
          connected = true;
          //Request an update from the location client to get current Location details
          mLocationClient.requestLocationUpdates(mLocationRequest,this);
          Toast.makeText(this, "Connected", Toast.LENGTH_SHORT).show();
      }
  </code></pre>
  
  <p>Which then entails this method being called</p>
  
  <pre><code>public void onLocationChanged(android.location.Location location) {
          // Report to the UI that the location was updated
          String msg = "Updated Location: " +
                  Double.toString(location.getLatitude()) + "," +
                  Double.toString(location.getLongitude());
          if(tmp != location.getLatitude())
          {
              Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
          }
          tmp = location.getLatitude();
      }
  </code></pre>
  
  <p>You can see I have 2 toasts there and they come back fine with the actual GPS coordinates but when I call the below code it crashes out on the new location line <code>getLastKnownLocation</code></p>
  
  <pre><code>public String getLocation()
      {
          // Get the location manager
          LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
          Criteria criteria = new Criteria();
          String bestProvider = locationManager.getBestProvider(criteria, false);
          android.location.Location location = locationManager.getLastKnownLocation(bestProvider);
          Double lat,lon;
          DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
          Date date = new Date();
          try {
              lat = location.getLatitude ();
              lon = location.getLongitude ();
              Toast.makeText(this,""+lat.toString()+"-"+lon.toString(),Toast.LENGTH_SHORT).show();
              return new LatLng(lat, lon).toString();
          }
          catch (NullPointerException e){
              Toast.makeText(this,"HELL-NO",Toast.LENGTH_SHORT).show();
              Log.e("HELL-NO","n",e);
              e.printStackTrace();
              return null;
          }
      }
  </code></pre>
  
  <p>I just don't get why when I try to retrieve the location, which seems to have been retrieved in the <code>onLocationChanged</code> method, it just comes up with a nullpointer.</p>