private static void registerImageClickListener(final Consumer<ImageSpan> clickAction, final Spannable spannable, final ImageSpan[] spans) {

        for (final ImageSpan span : spans) {
            final ClickableSpan clickableSpan = new ClickableSpan() {
                @Override
                public void onClick(@NonNull final View textView) {
                    clickAction.accept(span);
                }

                @Override
                public void updateDrawState(@NonNull final TextPaint ds) {
                    super.updateDrawState(ds);
                    ds.setUnderlineText(false);
                }
            };
            spannable.setSpan(clickableSpan, spannable.getSpanStart(span), spannable.getSpanEnd(span), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        }
    }
adds a custom click action to all images found in the spannable which don't have a click action already
main/src/main/java/cgeo/geocaching/utils/html/HtmlUtils.java