3

I have a multi-line TextView and I want to get the bounded rectangle of a particular word in that TextView. I have ClickableSpan Text in TextView, so when user clicks on a word, I want to show him/her a small window above that word. But to achieve this I must know the location of that word in that TextView or in that Windows.

Till now I can detect the exact word user has clicked. Any help would be appreciated. :)

P.S: Of course I can get the bounding rectangle of TextView as a whole but I want it at character/word level or AT LEAST LINE LEVEL.

Oded
  • 489,969
  • 99
  • 883
  • 1,009
M-Wajeeh
  • 17,204
  • 10
  • 66
  • 103
  • how do you get the exact word? Did this function supply some kind of event object that may contain the x and y coordinates of the click event. If so, could you compute the line from your textview position, event coordinates and textsize of your textview? – AxelTheGerman Dec 24 '11 at 09:41
  • @axel I answered my question here. In answer I have explained how I was able to "select a word on a tap in TextView/EditText". http://stackoverflow.com/questions/8612652/select-a-word-on-a-tap-in-textview-edittext – M-Wajeeh Dec 24 '11 at 12:24

0 Answers0