Search code examples
androidstringdynamictextviewclickablespan

How to set multiple on click listeners on different words of textview?


Just how the facebook app does it. Multiple clickable texts in one textView.

I tried the FlowLayout and multiple texviews but still the texview shifts to another line when the text exceeds the width. Multiple clickable texts in one texview


Solution

  • Spannable String are used in Android to highlight the particular portion of text with different click event in a Single TextView.

    You can check #SO Demo for this

    1. How to set the part of the text view is clickable

    2. Android: ClickableSpan in clickable TextView

    I hope it will helps you .