title: Why is LocationSettingsResult startResolutionForResult not calling onActivityResult?
body: <p>I've seen this Q&amp;A <a href="https://stackoverflow.com/questions/31235564/locationsettingsrequest-dialog-onactivityresult-skipped">LocationSettingsRequest dialog - onActivityResult() skipped</a>. It isn't the same issue because everything is being done in an Activity already.</p>
  
  <p>The code used is almost verbatim what is given in the Google Play Services examples.</p>
  
  <p>I have an activity, <code>LocationActivity</code>, that connects to GoogleApiClient for getting the user's location. Once connected I create a <code>LocationSettingsRequest</code> to make sure that location settings are turned on. The activity is implementing <code>ResultCallback&lt;LocationSettingsResult&gt;</code>.</p>
  
  <p><code>ResultCallback&lt;LocationSettingsResult&gt;.onResult()</code> is called and if <code>result.getStatus().getStatusCode() == LocationSettingsStatusCodes.RESOLUTION_REQUIRED</code> then <code>status.startResolutionForResult(this, REQUEST_CHECK_SETTINGS)</code> is called and the dialog is shown. <strong>The problem, no matter what is selected, <code>onActivityResult()</code> is never called.</strong></p>
  
  <pre><code>@Override
  public void onConnected(Bundle connectionHint) {
      Log.i(TAG, "GoogleApiClient connected");
      LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()
          .addLocationRequest(new LocationRequest().setPriority(LocationRequest.PRIORITY_LOW_POWER));
  
      PendingResult&lt;LocationSettingsResult&gt; result =
          LocationServices.SettingsApi.checkLocationSettings(googleApiClient, builder.build());
  
      result.setResultCallback(this);
  }
  </code></pre>
  
  <p>.</p>
  
  <pre><code>@Override
  public void onResult(LocationSettingsResult result) {
      final Status status = result.getStatus();
      Log.d(TAG, "onResult() called with: " + "result = [" + status.getStatusMessage() + "]");
      switch (status.getStatusCode()) {
          case LocationSettingsStatusCodes.SUCCESS:
              getLocation();
              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(this, REQUEST_CHECK_SETTINGS);
              } catch (IntentSender.SendIntentException e) {
                  Log.d(TAG, "", e);
                  // Ignore the error.
              }
              break;
          case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:
              showManualInputDialog();
              break;
      }
  }
  </code></pre>
  
  <p>I never get here:</p>
  
  <pre><code>@Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      Log.d(TAG, "onActivityResult() called with: " + "requestCode = [" + requestCode + "], resultCode = [" + resultCode + "], data = [" + data + "]");
      switch (requestCode) {
          case REQUEST_CODE_RESOLUTION:
              retryConnecting();
              break;
          case REQUEST_CHECK_SETTINGS:
              if (resultCode == Activity.RESULT_OK) {
                  getLocation();
              } else {
                  showManualInputDialog();
              }
              break;
          default:
              super.onActivityResult(requestCode, resultCode, data);
              break;
      }
  }
  </code></pre>
  
  <p>As an aside. It worked a few times on my S3. From what I can tell it stopped working when I chose to never ask again. But, it hasn't ever worked on an emulator or a Tab 10 and it no longer works on my S3.</p>