Home > Java > javaTutorial > body text

How to block EditText soft keyboard in Android

高洛峰
Release: 2017-01-07 11:56:25
Original
1670 people have browsed it

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对象
Copy after login

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)
Copy after login

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!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!