Keeping cursor on the right in EditText

Put your problem here if it does not fit any of the other categories.

Keeping cursor on the right in EditText

Postby jmejiaa » Sat Nov 15, 2008 6:38 pm

Hello all,

I am inputting text into a editText field via a virtual keyboard in my app, How can I make the cursor stay at the right the way it does when you input through a keyboard.

Thanks
jmejiaa
Junior Developer
Junior Developer
 
Posts: 22
Joined: Sat Nov 15, 2008 6:36 pm

Top

Postby MrSnowflake » Sat Nov 15, 2008 7:16 pm

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. myEditText.setSelection(myEditText.getText().toString().length());
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
Should do the trick. (or maybe .length() - 1)
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby jmejiaa » Sat Nov 15, 2008 7:29 pm

Worked great, thank you.
jmejiaa
Junior Developer
Junior Developer
 
Posts: 22
Joined: Sat Nov 15, 2008 6:36 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 19 guests