You can do it like this.

EditText eidtText = new EditText(this);
// first, you set text and then..
editText.setSelection(1);
editText.extendSelection(0);
editText.setSelection(0);

On 2월2일, 오후11시44분, Adam Olsen <[email protected]> wrote:
> Using the following code, I am able to move thecursorafter the first
> character on the left in anEditText:
>
> EditTexteditText= newEditText(this);
> Editable etext =editText.getText();
> Selection.setSelection(etext, 1);
>
> However, if I change it to Selection.setSelection(etext, 0) with the
> goal ofmovingthecursorto thebeginningof the text, it moves thecursor(or 
> doesn't move thecursor) to the end of the line instead of
> thebeginning.
>
> How can I move thecursorto thebeginningof the text?
>
> --
> Adam Olsen
> SendOutCards.comhttp://www.vimtips.orghttp://last.fm/user/synic

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to