Himanshu
Himanshu

Reputation: 1086

Cursor should appear from start in editText in android

I have a screen which have editText and a button, now when we click on the button it will fetch the Text from another screen and set to the editText. The problem is when the text has been set to edittext cursor position is coming at last. I want that cursor position should appear from start.

Any Idea?? Thanks.

Upvotes: 0

Views: 1321

Answers (1)

A.Quiroga
A.Quiroga

Reputation: 5720

MODIFIED

editText.requestFocus();
editText.setSelection(0);

Upvotes: 4

Related Questions