code: public static boolean handleActivityResult(Context context, PendingCall appCall, int requestCode, Intent data,
              Callback callback) {
          if (requestCode != appCall.getRequestCode()) {
              return false;
          }
  
          if (attachmentStore != null) {
              attachmentStore.cleanupAttachmentsForCall(context, appCall.getCallId());
          }
  
          if (callback != null) {
              if (NativeProtocol.isErrorResult(data)) {
                  Exception error = NativeProtocol.getErrorFromResult(data);
  
                  // TODO  - data.getExtras() doesn't work for the bucketed protocol.
                  callback.onError(appCall, error, data.getExtras());
              } else {
                  callback.onComplete(appCall, NativeProtocol.getSuccessResultsFromIntent(data));
              }
          }
  
          return true;
      }
docs: Parses the results of a dialog activity and calls the appropriate method on the provided Callback.
  
  @param context     the Context that is handling the activity result
  @param appCall     an PendingCall containing the call ID and original Intent used to launch the dialog
  @param requestCode the request code for the activity result
  @param data        the result Intent
  @param callback    a callback to call after parsing the results
  @return true if the activity result was handled, false if not