Reputation: 51
How can i set the cursor position in android edit text? Im making a button which would make the cursor one character forward ie. an arrow key like
Upvotes: 1
Views: 2357
Reputation: 2427
You can length of the string entered in edit text.
editText.setSelection(editText.getText().length());
Upvotes: 3
Reputation: 785
You have to use setSelection(int position) method of edittext. Like edt.setSelection(0)
Upvotes: 1