I am building an application where the user enters text into an EditText.
I would like to be able to have the user touch a word, and detect the word at the pixel location they touched. Is there any way to do this?
Thanks, Victor
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You may want to take a look at Spans. Particularly, ClickableSpan. You can assign a span to a part of the text to give that part of the text some “features” (in this case, it will make the text clickable).
There’s a nice example, in which custom Spans extending ClickableSpan are used in EditText to make the text display more user-friendly.