I am working on custom InputConnection in android. Everything is working fine, but i want to get characters between cursor’s current position and start position of particular word.
Is there any suggestion? how can i do that?
Thanks..
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.
getSelectionStart() might be the answer here. It return the position of the cursor. Then parse the text from 0 to that position. This comes from TextView.
If u want to get that information from InputConnection, it’s hard because there is no API for getting the cursor position there.