code: @Override
    public boolean onTouchEvent(final @NotNull MotionEvent event) {
      final Spannable text = (Spannable)getText();
      if (text != null) {
        if (event.getAction() == MotionEvent.ACTION_DOWN) {
          final Layout layout = getLayout();
          if (layout != null) {
            // final int pos = getOffsetForPosition(event.getX(), event.getY()); // API >= 14 only
            final int line = getLineAtCoordinate(layout, event.getY());
            final int pos = getOffsetAtCoordinate(layout, line, event.getX());
            final ClickableSpan[] links = text.getSpans(pos, pos, ClickableSpan.class);
            if (links != null && links.length > 0) {
              links[0].onClick(this);
              return true;
            }
          }
        }
      }
      return super.onTouchEvent(event);
    }
docs: We want our text to be selectable, but we still want links to be clickable.