code: public View.OnLongClickListener getOnLongClickListener(boolean adapterHasListener) {
          if (isLongClickable() && adapterHasListener) {
              if (mViewHolderLongClickListener == null) {
                  mViewHolderLongClickListener = new ViewHolderLongClickListener<>(this);
              }
          } else {
              mViewHolderLongClickListener = null;
          }
          return mViewHolderLongClickListener;
      }
docs: Get the OnLongClickListener to call when the user long-click on the item.
  @param adapterHasListener true if the calling adapter has a global listener on the item.
  @return the long-click listener to be put into the view.