code: public void onClickOk(@NonNull View view) {
          if (mListener == null) {
              return;
          }
  
          // Some invalid cases first
          /*if (MODE_NEW_FILE == mode && !isValidFileName(getNewFileName())) {
              mToast = Toast.makeText(getActivity(), R.string.nnf_need_valid_filename,
                      Toast.LENGTH_SHORT);
              mToast.show();
              return;
          }*/
          if ((allowMultiple || mode == MODE_FILE) &&
                  (mCheckedItems.isEmpty() || getFirstCheckedItem() == null)) {
              if (mToast == null) {
                  mToast = Toast.makeText(getActivity(), R.string.nnf_select_something_first,
                          Toast.LENGTH_SHORT);
              }
              mToast.show();
              return;
          }
  
          // New file allows only a single file
          if (mode == MODE_NEW_FILE) {
              final String filename = getNewFileName();
              final Uri result;
              if (filename.startsWith("/")) {
                  // Return absolute paths directly
                  result = toUri(getPath(filename));
              } else {
                  // Append to current directory
                  result = toUri(getPath(appendPath(getFullPath(mCurrentPath), filename)));
              }
              mListener.onFilePicked(result);
          } else if (allowMultiple) {
              mListener.onFilesPicked(toUri(mCheckedItems));
          } else if (mode == MODE_FILE) {
              //noinspection ConstantConditions
              mListener.onFilePicked(toUri(getFirstCheckedItem()));
          } else if (mode == MODE_DIR) {
              mListener.onFilePicked(toUri(mCurrentPath));
          } else {
              // single FILE OR DIR
              if (mCheckedItems.isEmpty()) {
                  mListener.onFilePicked(toUri(mCurrentPath));
              } else {
                  mListener.onFilePicked(toUri(getFirstCheckedItem()));
              }
          }
      }
docs: Called when the ok-button is pressed.
  
  @param view which was clicked. Not used in default implementation.