I\'m defining an edit text like so...
Here is an updated answer:
android:maxLines="1"
The accepted answer of android:singleLine="true"
has been deprecated.
Simple solution: add android:singleLine="true"
for the EditText. This will replace the enter with Next (for all edittexts except the last one) and Done (for the last one).
android:imeOptions="actionNext"
It replaces the name of the enter key with "Next" in the virtual keyboard and by clicking on it - focus jumps to the next field
In your layout, you would do things like this
<EditText
...
android:text="Field 1"
android:imeOptions="actionNext" />
<EditText
...
android:text="Field 2"
android:imeOptions="actionNext" />
And in Java
TextView field2 = (TextView) field1.focusSearch(View.FOCUS_RIGHT);
field2.requestFocus();
It's up to you to decide which field will request focus next.
About your other question, getting the text to auto-erase, you should include it in android:hint
instead of android:text
.
Just add in the EditText XML : android:imeOptions="actionDone"