Sie können für EditText
in xml
nutzen die imeOptions
verfügbar zuschreiben.
Versuchen Sie Folgendes. In meinem Fall hat es funktioniert.
In XML:
<EditText
android:id="@+id/edit_text1"
android:layout_width="match_parent"
android:layout_height="45dp"
android:digits="abcdefghijklmnopqrstuvwxyz. "
android:imeOptions="actionNext"/>
<EditText
android:id="@+id/edit_text2"
android:layout_width="match_parent"
android:layout_height="45dp"/>
Dann in JAVA:
EditText edit_text1 = (EditText) findViewById (R.id.edit_text1);
EditText edit_text2 = (EditText) findViewById (R.id.edit_text2);
edit_text1.setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
boolean handled = false;
if (actionId == EditorInfo.IME_ACTION_NEXT) {
edit_text2.requestFocus();
handled = true;
}
return handled;
}
});
Dank adaequat –
hier nicht arbeiten. Wenn das Attribut digits vorhanden ist, funktioniert imeOptions nicht. Warum das ? –
@BugsHappen Für eine Reparatur versuchen Sie, android: singleLine = "true", refered von http://stackoverflow.com/questions/11048007/using-androiddigits-attribute-to-restricts-characters-stops-action-next-button- w –