code: protected void startActivityForResult(Intent intent, int code) {
      if (fragment == null) {
        activity.startActivityForResult(intent, code);
      } else {
        fragment.startActivityForResult(intent, code);
      }
    }
docs: Start an activity. This method is defined to allow different methods of activity starting for
  newer versions of Android and for compatibility library.
  
  @param intent Intent to start.
  @param code Request code for the activity
  @see Activity#startActivityForResult(Intent, int)
  @see Fragment#startActivityForResult(Intent, int)