0

Here's a a link about how to select a word in textview on single tap. I want to make the word selected change the background color to grey and keep grey until the user click elsewhere. However, I have extended LinkMovementMethod to the textview, but this way is not able to reverse the background color to transparent when I click else where.

Here is the example of my failed attempt. enter image description here

In other words, at most one word is highlighted. How to achieve that?

user6456568
  • 579
  • 9
  • 23

1 Answers1

0

You can store start and end of the word you highlited. And when user clicks other word just remove old span, override start and end variable and mark new word.

muminers
  • 1,190
  • 10
  • 19