Android Soft Keyboard event listener enter key
The interface of the software disk is replaced with only one attribute android:imeoptions, the value of this property can be Normal,actionunspecified,actionnone,actiongo,actionsearch, Actionsend,actionnext,actiondone, for example, the Enter key appearance becomes a down arrow when the value is Actionnext, and the ENTER key looks like a "complete" two characters when the values are actiondone.
We can also override the Enter event by doing the following
Java code
- TextView EditText = new TextView (this);
- Edittext.setoneditoractionlistene (
- Newtextview.oneditoractionlistener () {
- Public Boolean oneditoraction (TextView V, int ActionId,
- KeyEvent event) {
- if (ActionId = = editorinfo.ime_action_send)
- {
- //write the functions you want to implement here
- }
- return false;
- }
- });
About the replacement of the Android soft keyboard enter key and the event listener