Actionnone: Enter, press the cursor to the next line
Actiongo:go,
Actionsearch: Magnifying Glass
Actionsend:send
Actionnext:next
Actiondone:done, OK/finish, hide soft keyboard, even if not the last text input box
Android:singleline= "true"
Android:imeoptions= "Actionsearch"
Edittext.setoneditoractionlistener Setting monitoring
@Override Public BooleanOneditoraction (TextView V,intActionId, KeyEvent event) { BooleanIsOK =true; Switch(ActionId) { CaseEditorInfo.IME_ACTION_NONE:Toast.makeText (Mcontext,"Click-->none", Toast.length_short). Show (); Break; CaseEditorInfo.IME_ACTION_GO:Toast.makeText (Mcontext,"Click-->go", Toast.length_short). Show (); Break; CaseEditorInfo.IME_ACTION_SEARCH:Toast.makeText (Mcontext,"Click-->search", Toast.length_short). Show (); Break; CaseEditorInfo.IME_ACTION_SEND:Toast.makeText (Mcontext,"Click-->send", Toast.length_short). Show (); Break; CaseEditorInfo.IME_ACTION_NEXT:Toast.makeText (Mcontext,"Click-->next", Toast.length_short). Show (); Break; default: IsOK=false; Break; }
<?XML version= "1.0" encoding= "Utf-8"?><LinearLayoutxmlns: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/activity_horizontal_margin"Android:paddingright= "@dimen/activity_horizontal_margin"Android:paddingtop= "@dimen/activity_vertical_margin"Tools:context= "Com.edwin.demokeyboard.MainActivity"> <TextViewAndroid:layout_width= "Match_parent"Android:layout_height= "50DP"android:gravity= "Center"Android:text= "Change the bottom right corner of the soft keyboard to determine the key style"android:textsize= "20SP" /> <EditTextAndroid:id= "@+id/et_main_one"Android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:hint= "Actiongo"android:imeoptions= "Actiongo"Android:singleline= "true" /> <EditTextAndroid:id= "@+id/et_main_two"Android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:hint= "Actionsearch"android:imeoptions= "Actionsearch"Android:singleline= "true" /> <EditTextAndroid:id= "@+id/et_main_three"Android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:hint= "Actionsend"android:imeoptions= "Actionsend"Android:singleline= "true" /> <EditTextAndroid: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 Address:
Android app three ways to monitor soft keyboard keys and change the bottom right corner of the soft keyboard to determine the key style