How to get cursor position in Edittext editor

I am making an android application. In my application, I need to find the position of the edittext cursor. For example, I put the text "how are you" in the edittext. If I click next to the 'a' character, then I need to find the cursor before the "a".

How to find out the position of the cursor and the character where the cursor is?

+6
source share
1 answer

Use the getSelectionStart() method to get the current cursor position in the Edittext

+20
source

Source: https://habr.com/ru/post/911261/


All Articles