I have an anctivity with 6 EditText... the activity is working good, but I need to click on each EditText to fill it...
How can I make enter key change the focus to another EditText?
What I've already tried
1. I already setted OnKeyListener on every EditText.
switch (v.getId()) {
case R.id.editText1:
activity.findViewById(R.id.editText2).requestFocus();
return true;
case R.id.editText2:
activity.findViewById(R.id.editText3).requestFocus();
return true;
case R.id.editText3:
activity.findViewById(R.id.editText4).requestFocus();
return true;
.
.
.
}
But, when I click on enter key, before the focus change to another EditText, a new line is create on previous EditText.
2. I've add android:singleLine="true"
to every EditText. It isn't work on EditText with inputType="number"