In my application i have edit text as follows.
EditText1 EditText2
EditText3 EditText4
EditText5 EditText6
in xml i declared android:imeOptions="actionNext"
and also i write
editText1.setOnEditorActionListener(new EditText.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
// TODO Auto-generated method stub
if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_NEXT) {
editText2.requestFocus();
return false;
}
return false;
}
});
Now in virtual key board in edit text 1 if i press next i am getting focus into edit text3 instead of editText2 etc.
How can i get focus on EditText2 instead of edittext3 for my application user only press "Next or done" he never goes for trackball.
I just tested your code with the following layout and it worked as expected. (Expected = clicking next on the virtual keyboard the focused was passed to editText2)
Here's also the source
}
After writing the above code my issue is solved,Thanks all for your answers and support.
You could try adding the
android:nextFocusDown
attribute in yourEditTexts
.