8

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

How can I find out the cursor position and the character where cursor is placed?

David Cain
  • 16,484
  • 14
  • 65
  • 75
sarath
  • 3,181
  • 7
  • 36
  • 58

1 Answers1

25

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

Lucifer
  • 29,392
  • 25
  • 90
  • 143
Yugandhar Babu
  • 10,311
  • 9
  • 42
  • 67