The example in this article describes how to block the EditText soft keyboard in Android. Share it with everyone for your reference. The details are as follows:
The java code is as follows:
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(myEdit.getWindowToken(), 0); //myEdit是你的EditText对象
You can restore the display through the following method:
boolean showSoftInput(View view, int flags, ResultReceiver resultReceiver) boolean showSoftInput(View view, int flags) void showSoftInputFromInputMethod(IBinder token, int flags)
I hope this article will be helpful to everyone’s Android programming design.
For more related articles on how to block the EditText soft keyboard on Android, please pay attention to the PHP Chinese website!