title: Constant location request on startup
body: <p>So I am trying to make an app in Android Studio which needs location settings turned on and therefor I wanted to make that window pop up in onCreate that asks if you would like to turn on location settings. But after you press Abort I dont know how to bring that window back again...
  Is there a way to do so? Because I have seen in some apps like Tinder, that they won't start until you have pressed a few times on the Abort button.</p>
  
  <pre><code>LocationRequest mLocationRequest;
      GoogleApiClient mGoogleApiClient;
      PendingResult&lt;LocationSettingsResult&gt; result;
      final static int REQUEST_LOCATION = 199;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          mGoogleApiClient = new GoogleApiClient.Builder(this)
                  .addApi(LocationServices.API)
                  .addConnectionCallbacks(this)
                  .addOnConnectionFailedListener(this).build();
          mGoogleApiClient.connect();
  
      }
  
      @Override
      public void onConnected(Bundle bundle) {
  
          mLocationRequest = LocationRequest.create();
          mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
          mLocationRequest.setInterval(30 * 1000);
          mLocationRequest.setFastestInterval(5 * 1000);
  
          LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()
                  .addLocationRequest(mLocationRequest);
          builder.setAlwaysShow(true);
  
          result = LocationServices.SettingsApi.checkLocationSettings(mGoogleApiClient, builder.build());
  
          result.setResultCallback(new ResultCallback&lt;LocationSettingsResult&gt;() {
              @Override
              public void onResult(LocationSettingsResult result) {
                  final Status status = result.getStatus();
                  Log.d("Status: ", result.toString());
                  //final LocationSettingsStates state = result.getLocationSettingsStates();
                  switch (status.getStatusCode()) {
                      case LocationSettingsStatusCodes.SUCCESS:
                          // All location settings are satisfied. The client can initialize location
                          // requests here.
                          //...
                          break;
                      case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:
                          // Location settings are not satisfied. But could be fixed by showing the user
                          // a dialog.
                          try {
                              // Show the dialog by calling startResolutionForResult(),
                              // and check the result in onActivityResult().
                              status.startResolutionForResult(
                                      MainActivity.this,
                                      REQUEST_LOCATION);
                          } catch (IntentSender.SendIntentException e) {
                              // Ignore the error.
                          }
                          break;
                      case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:
                          // Location settings are not satisfied. However, we have no way to fix the
                          // settings so we won't show the dialog.
                          //...
                          break;
                  }
              }
          });
  
      }
  
      @Override
      public void onActivityResult(int requestCode, int resultCode, Intent data)
      {
          Log.d("onActivityResult()", Integer.toString(resultCode) + "," + Integer.toBinaryString(requestCode));
  
          switch (requestCode)
          {
              case REQUEST_LOCATION:
                  switch (resultCode)
                  {
                      case Activity.RESULT_OK:
                      {
                          // All required changes were successfully made
                          Toast.makeText(MainActivity.this, "Location enabled by user!", Toast.LENGTH_LONG).show();
                          break;
                      }
                      case Activity.RESULT_CANCELED:
                      {
                          // The user was asked to change settings, but chose not to
                          Toast.makeText(MainActivity.this, "Location not enabled, user cancelled.", Toast.LENGTH_LONG).show();
                          break;
                      }
                      default:
                      {
                          break;
                      }
                  }
                  break;
          }
      }
  
      @Override
      public void onConnectionSuspended(int i) {
  
      }
  
      @Override
      public void onConnectionFailed(ConnectionResult connectionResult) {
  
      }
  </code></pre>