0

I see that after android 3.0 it introduce into the isselectable attribute, but i found even in android 2.1, the SMS editbox can allow user double click a word you typed and highlight to select it. how does it work? i thought it's a regular edittext box but it's not. the layout edittext box can't doubleclick and select a single word, it can just press and drag to select, and it works very bad.

so, does anyone know how to implement this: when i double click(or long click) a word of the text in TextView(or any other view), the word can be selected and i can perform some actions.

who knows how the SMS editing box implement?

thanks.

David W
  • 111
  • 1
  • 4

1 Answers1

0

I did answer a (somehow) similar question here. The solutions should work from Android 1.5

But this works with the "mark some text"-solution. Maybe it's helpful anyways.

Community
  • 1
  • 1
Lukas Knuth
  • 25,449
  • 15
  • 83
  • 111
  • thanks, Knuth, I read your previous post, but it seems that method 1 only select the whole view(which is all text), and the method 2 just use the EditText's default selectable attributes, but as I have said, it seems not work well, it is hard to drag and select words accurately. And besides, I prefer select ONE word by just double click(or long click) that word. have any other better suggestions? – David W Oct 10 '11 at 10:29
  • I'll need to do some research and I'm currently at work. I'll get back to you this evening. – Lukas Knuth Oct 10 '11 at 10:33