You can get the cursor position using the getSelectionStart () and getSelectionEnd () methods. If no text is selected, both the getSelectionStart () and getSelectionEnd () methods return the cursor position. So something like this should do the trick:
myEditText.getSelectionStart();
or
myEditText.getSelectionEnd();
Then, if you want to select all the text after the cursor, you can use this:
int cursorPosition = myEditText.getSelectionStart(); CharSequence enteredText = myEditText.getText().toString(); CharSequence cursorToEnd = enteredText.subSequence(cursorPosition, enteredText.length());
theisenp Aug 01 2018-11-11T00: 00Z
source share