Android edittext - settextmethod cursor issue
I am trying to settext in an开发者_StackOverflow中文版 EditText...But after setText is done, the cursor remains at the start of text.how can i move it to the end of the text?
Any help in this regard is appreciated.
Best Regards, Rony
EditText inputField;
Editable etext = inputField.getText();
int position = etext.length();
inputField.setSelection(position);
Use append(CharSequence text)
. This will also update the position of the cursor. See Android Documentation
Try append("Hello");
instead of setText()
精彩评论