Android app three ways to monitor soft keyboard keys and change the bottom right corner of the soft keyboard to determine the key style

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.