Android App monitors the keyboard buttons in three ways and changes the keyboard's bottom right corner to determine the key style, androidapp
ActionNone: Enter key. Press the button and move the cursor to the next line.
ActionGo: Go,
ActionSearch: magnifiers
ActionSend: Send
ActionNext: Next
ActionDone: Done, OK/complete, hide the keyboard, even if it is not the last text input box
Android: singleline = "true"
Android: imeoptions = "actionSearch"
EditText. setoneditexceptionlistener
@ Override public boolean oneditequaltion (TextView v, int actionId, KeyEvent event) {boolean isOK = true; switch (actionId) {case EditorInfo. IME_ACTION_NONE: Toast. makeText (mContext, "click --> NONE", Toast. LENGTH_SHORT ). show (); break; case EditorInfo. IME_ACTION_GO: Toast. makeText (mContext, "click --> GO", Toast. LENGTH_SHORT ). show (); break; case EditorInfo. IME_ACTION_SEARCH: Toast. makeText (mContext, "click --> SEARCH", Toast. LENGTH_SHORT ). show (); break; case EditorInfo. IME_ACTION_SEND: Toast. makeText (mContext, "click --> SEND", Toast. LENGTH_SHORT ). show (); break; case EditorInfo. IME_ACTION_NEXT: Toast. makeText (mContext, "click --> NEXT", Toast. LENGTH_SHORT ). show (); break; default: isOK = false; break ;}
<? Xml version = "1.0" encoding = "UTF-8"?> <LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http://schemas.android.com/tools" android: layout_width = "match_parent" android: layout_height = "match_parent" android: orientation = "vertical" android: paddingBottom = "@ dimen/activity_vertical_margin" android: paddingLeft = "@ dimen/plugin" android: paddingRight = "@ dimen/plugin" android: paddingTop = "@ dimen/plugin" tools: context = "com. edwin. demokeyboard. mainActivity "> <TextView android: layout_width =" match_parent "android: layout_height =" 50dp "android: gravity =" center "android: text =" change the key style in the lower right corner of the keyboard "android: textSize = "20sp"/> <EditText android: id = "@ + id/et_main_one" android: layout_width = "match_parent" android: layout_height = "wrap_content" android: hint = "actionGo" android: imeOptions = "actionGo" android: singleLine = "true"/> <EditText android: id = "@ + id/et_main_two" android: layout_width = "match_parent" android: layout_height = "wrap_content" android: hint = "actionSearch" android: imeOptions = "actionSearch" android: singleLine = "true"/> <EditText android: id = "@ + id/et_main_three" android: layout_width = "match_parent" android: layout_height = "wrap_content" android: hint = "actionSend" android: imeOptions = "actionSend" android: singleLine = "true"/> <EditText android: id = "@ + id/et_main_four" android: layout_width = "match_parent" android: layout_height = "wrap_content" android: hint = "actionNext" android: imeOptions = "actionNext" android: singleLine = "true"/> </LinearLayout>
Source Code address: