Recently in the dial-up application, you need to click on the input box to play a custom keyboard, hide the system's input method. Online to find a lot of information, finally to solve, through Android:inputtype: Specify the type of input method, int type, you can use | select multiple. The value can be referenced by: Android.text.InputType class. The values include: Text,texturi, Phone,number, etc.
In the Android SDK there is such a phrase "If the given content type is Type_null then a soft keyboard would not be displayed for this text view",
First change the EditText inputtype to Type_null, the input method will not pop up. Then set the listener, and then reset its inputtype.
Et_input.setontouchlistener (NewOntouchlistener () {@Override Public BooleanOnTouch (View V, motionevent event) {LOGUTIL.E (TAG,"EditText Click"); intIntype = Et_input.getinputtype ();//backup the input typeEt_input.setinputtype (Inputtype.type_null);//Disable Soft inputEt_input.ontouchevent (event);//Call Native HandlerEt_input.setinputtype (Intype);//Restore input type//after the cursor is placedCharsequence Text =Et_input.gettext (); if(Textinstanceofspannable) {spannable Spantext=(spannable) text; Selection.setselection (Spantext, Text.length ()); } if(Ll_keyboard.getvisibility () ==view.gone) {//pop-up dial padll_options.setvisibility (View.gone); Ll_keyboard.setvisibility (view.visible); } return true; } });
Source: http://www.xuebuyuan.com/2005929.html
Go Android EditText does not eject IME and cursor settings