title: fusedLocationProviderClient.lastLocation.addOnSuccessListener always null
body: <p>I just updated my Location API to use FusedLocationProviderClient but I am having this issue, when I turn off and on the GPS, I am always getting null location:</p>
  
  <pre><code>val fusedLocationProviderClient =
                          LocationServices.getFusedLocationProviderClient(callingActivity)
              fusedLocationProviderClient.flushLocations()
              getLocationRequest()
  
              checkLocationSettings(callingActivity, turnOnGpsRequestCode, callback) {
                  // Location settings successful
                  fusedLocationProviderClient.lastLocation
                          .addOnSuccessListener(callingActivity) {
                              location -&gt;
                              // Here location is always null
  callback.onCallback(MenumyRadar.RadarStatus.SUCCESS, location)
                          }
                          .addOnFailureListener {
                              callback.onCallback(MenumyRadar.RadarStatus.ERROR_UNKNOWN, null)
                          }
              }
  </code></pre>
  
  <p>It doesn´t work until I open another app which uses location, as Google Maps or Uber.</p>
  
  <p>I have some clue thanks to this answer
  <a href="https://stackoverflow.com/questions/29441384/fusedlocationapi-getlastlocation-always-null">FusedLocationApi.getLastLocation always null</a></p>
  
  <p>And to Google´s explanation:</p>
  
  <blockquote>
    <p>fusedLocationClient.lastLocation
            .addOnSuccessListener {
     location : Location? ->
                // Got last known location. In some rare situations this can be null.
     } </p>
    
    <p>The getLastLocation() method returns a Task that you can use to get a Location object with the latitude and longitude coordinates
    of a geographic location. The location object may be null in the
    following situations:</p>
    
    <p>Location is turned off in the device settings. The result could be
    null even if the last location was previously retrieved because
    disabling location also clears the cache. The device never recorded
    its location, which could be the case of a new device or a device that
    has been restored to factory settings. Google Play services on the
    device has restarted, and there is no active Fused Location Provider
    client that has requested location after the services restarted. To
    avoid this situation you can create a new client and request location
    updates yourself. For more information, see Receiving Location
    Updates.</p>
  </blockquote>
  
  <p>But it does not say how to handle this, what can I do?</p>