Android EditText's cursor position tracking when clicking or toching by first time itself
i am struggling with EditText for morethan a day. My goal is to know current cursor positon that user's first click on the EditText.
- Assume current cursor at po开发者_如何学Csition "5",
- Click EditText widget at position "8",
- At this moment getSelectionStart() retrieve previous value say "5".
- Click EditText widget at position "8" again,
getSelectionStart()
retrieve the position become "8", (This is correct, but need click twice at same position)- Click on a new position, situation will repeat Step3.
Just try:
getSelectionEnd()
(If your action doesn't contain selecting a range of text.)
精彩评论