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
Post a Comment