*1. add android:imeOptions="actionNext" for all the EditText in layout xml *
*2. For your 2 horizontal edittext d/e, set OnEditorActionListener for them;
*
*EditText et = (EditText) this.findViewById(.......);
et.setOnEditorActionListener( new OnEditorActionListener() {*
* **public boolean onEditorAction(TextView v, int actionId,KeyEvent
event) {
switch(actionId) {
**case EditorInfo.IME_ACTION_NEXT:*
*
TextView v1 =
(TextView)v.focusSearch(View.FOCUS_RIGHT);
if (v1 != null) {
if (!v1.requestFocus(View.FOCUS_RIGHT)) {
throw new IllegalStateException("unfocucsable
view.....");//shouldn't get here for your layout
}
} else {
v1 = (TextView) v.focusSearch(View.FOCUS_DOWN);
if(v1 != null) {
if(!v1.requestFocus(View.FOCUS_DOWN)) {*
* throw new
IllegalStateException("unfocucsable view..."); //should get here for your
layout
}
}
}
break;
**default:*
*
v.onEditorAction(actionId);
break;
}
return true;
}*
* } );
*
*Of course, you can have more than 2 edittexts in a line. Also you can
override the implementation as per the actual layout.*
2010/1/1 csyperski <[email protected]>
> Is it possible when using imeOptions="actionNext" to make the focus go
> to the next field from left to right instead of just vertical. For
> example is I have a layout like
>
> EditText - A
> EditText - b
> EditText - c
> <linearLayout horizontal>EditText - d | EditText - e</linearlayout>
> EditText - f
>
> The order seems to go, if using the next button on the soft keyboard:
> A, B, C, D, F, but I want A, B, C, D, E, F. Is there a way to make it
> from left to right, then top to bottom, instead of just top to bottom?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en