How can I get the last character before cursor position in a edittext view? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can I get the last character before cursor position in a edittext view?

I am developing a simple Android math calculator. if the user changes the position of the cursor, I want to check the character that is just before cursor, so I can assign some command to some buttons in the app.

13th Jan 2018, 6:35 PM
Jamiu Akinyemi
Jamiu Akinyemi - avatar
2 Answers
+ 1
On a 3 seconds search in Google - literally - I found this article: https://stackoverflow.com/questions/6900408/get-cursor-position-in-android-in-edit-text Mind knowing that almost every question has an answer in Google.
19th Sep 2018, 6:43 AM
Eldar Bakerman
0
Eldar Bakerman thanks, I've already got the answer
20th Sep 2018, 1:18 PM
Jamiu Akinyemi
Jamiu Akinyemi - avatar