android - How to check if the cursor position in edit text is first or not? -


i have edit text in layout. after user operations, want check if cursor position first position or @ other position. how that?

you can cursor position using getselectionstart() , getselectionend() methods. if no text highlighted, both getselectionstart() , getselectionend() return position of cursor. can like:

youredittext.getselectionstart(); 

or

youredittext.getselectionend(); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -