Question

I would like to create a book reader and for this i have a problem of selecting some text and i don't know what is the best way. I read some posts in which they where using EditText for selection. But this is not so usefull because when you long tap it shows select word/select all and the keyboard appears, what i want is only the possibility to select text, listen the selection and then using Spannable/Linkify to edit that portion of text.

If there is no easy thing to use the standard text cursor controllers, can i create a custom cursor controllers or something like that ?

I read this posts:

Select text from TextView?

How to allow the user to select a text range in a TextView (Similar to EditText)

Thank you in advance.

Update:

I found this class android.text.Selection that seems to use the cursor controllers But i don't find any examples on google about it.

No correct solution

OTHER TIPS

Use android:textIsSelectable="true" on your TextView.

I'm made a custom TextView with selection capability by studying Android's source code. Please see my answer from the other question Android- How can I show text selection on textview?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top