I have a SpannableString
set as the text of my TextView
which is inside another view that has a click handler. I've got ClickableSpan
s inside my text which are, you are right, clickable.
My problem is that I need touch events to be captured in case of a click inside the clickable span and not to propagate to parent view (as the parent has another click handler).
The container view is simply a feed of posts in my app, and those posts can contain hashtags/mentions/links etc. If a user taps a hashtag, they should go to the hashtag which is handled by the clickable span, otherwise, they should go to the post, which is handled by the container itself.
Is there any straightforward mechanism to implement this functionality?