code: public final boolean onActivityResult(Activity currentActivity, int requestCode, int resultCode, Intent data) {
          Validate.notNull(currentActivity, "currentActivity");
  
          initializeStaticContext(currentActivity);
  
          synchronized (lock) {
              if (pendingAuthorizationRequest == null || (requestCode != pendingAuthorizationRequest.getRequestCode())) {
                  return false;
              }
          }
  
          Exception exception = null;
          AuthorizationClient.Result.Code code = AuthorizationClient.Result.Code.ERROR;
  
          if (data != null) {
              AuthorizationClient.Result result = (AuthorizationClient.Result) data.getSerializableExtra(
                      LoginActivity.RESULT_KEY);
              if (result != null) {
                  // This came from LoginActivity.
                  handleAuthorizationResult(resultCode, result);
                  return true;
              } else if (authorizationClient != null) {
                  // Delegate to the auth client.
                  authorizationClient.onActivityResult(requestCode, resultCode, data);
                  return true;
              }
          } else if (resultCode == Activity.RESULT_CANCELED) {
              exception = new FacebookOperationCanceledException("User canceled operation.");
              code = AuthorizationClient.Result.Code.CANCEL;
          }
  
          if (exception == null) {
              exception = new FacebookException("Unexpected call to Session.onActivityResult");
          }
  
          logAuthorizationComplete(code, null, exception);
          finishAuthOrReauth(null, exception);
  
          return true;
      }
docs: Provides an implementation for {@link Activity#onActivityResult
  onActivityResult} that updates the Session based on information returned
  during the authorization flow. The Activity that calls open or
  requestNewPermissions should forward the resulting onActivityResult call here to
  update the Session state based on the contents of the resultCode and
  data.
  
  @param currentActivity The Activity that is forwarding the onActivityResult call.
  @param requestCode     The requestCode parameter from the forwarded call. When this
  onActivityResult occurs as part of Facebook authorization
  flow, this value is the activityCode passed to open or
  authorize.
  @param resultCode      An int containing the resultCode parameter from the forwarded
  call.
  @param data            The Intent passed as the data parameter from the forwarded
  call.
  @return A boolean indicating whether the requestCode matched a pending
  authorization request for this Session.