-1

Is it possible to have TextView like this?

Why Doesn’t McDonald Sell Hotdogs?

In above question, Hotdogs will be in red color or underlined, when the user clicks on Hotdogs, it will show another dialog or popup view explaining what is Hotdogs.

Is it possible to do or any hints how may I accomplish it ?

AhKey
  • 9
  • 3
  • `TextView` can handle [`SpannableString`](http://developer.android.com/reference/android/text/SpannableString.html). That's probably what you are looking for, although there's little documentatioin on their usage – David Medenjak Jan 09 '16 at 23:44
  • Welcome to Stack Overflow. I have fixed a few English issues with your post. Please edit your post and share what you have tried so far. – Rohit Gupta Jan 10 '16 at 00:52
  • To David Medenjak, that's what I'm looking for, thanks a lot. – AhKey Jan 10 '16 at 01:11
  • Check this out http://stackoverflow.com/questions/10696986/how-to-set-the-part-of-the-text-view-is-clickable – Nitti Lin Jan 10 '16 at 03:13
  • How do I accept an answer? – AhKey Jan 10 '16 at 03:25
  • You have to click on the grey checkbox [next to the answer](http://meta.stackexchange.com/a/5235/261299). – Yaroslav Admin Jan 10 '16 at 16:07
  • I would like to give the credit to David Medenjak because he is the first one provide the correct solution. How may I do that? – AhKey Jan 13 '16 at 04:37

1 Answers1

0

You should use SpannableString.

Quoting from the Android reference

This is the class for text whose content is immutable but to which markup objects can be attached and detached. For mutable text, see SpannableStringBuilder.

David Brossard
  • 13,584
  • 6
  • 55
  • 88