1.android:imeoptions can be used to configure the input method in the lower right corner:
This can add the corresponding attribute in the XML android:imeoptions
Actiongo IME in the lower right corner shows "go to"
Actionsearch IME Display "search" in the lower right corner
Actionsend Input Method displays "send" in the lower right corner
Actionnext IME displays "Next" in the lower right corner
Actiondone IME displays "done" in the lower right corner
The Actionprevious Input method displays "previous" in the lower right corner.
You must set android:inputtype= after "text" to take effect.
2. Listen to the lower right button:
PrivateOneditoractionlistener ActionListener =NewOneditoractionlistener () {@Override Public BooleanOneditoraction (TextView V,intActionId, KeyEvent event) { Switch(V.getid ()) { CaseR.id.first:if(ActionId = =editorinfo.ime_action_send) { } Break; CaseR.id.second: Break; default: Break; } return false; } };
actionunspecified unspecified, corresponding constant editorinfo.ime_action_unspecified.
Actionnone no action, corresponding constant Editorinfo.ime_action_none
Actiongo, corresponding constant editorinfo.ime_action_go
Actionsearch search, corresponding constant editorinfo.ime_action_search
Actionsend send, corresponding constant editorinfo.ime_action_send
Actionnext Next, corresponding constant Editorinfo.ime_action_next
Actiondone complete, corresponding constant Editorinfo.ime_action_done
This allows you to customize the behavior of the lower-right button.
Android EditView IME