How to hide Keypad without Clicking Back Button

This question already has an answer here:

  • Close/hide the Android Soft Keyboard 69 answers

  • you should use TextWatcher to know when u complete typing, and then u can hide keyboard as below:

     EditText editText;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    
        editText = (EditText)findViewById(R.id.editText);
        editText.addTextChangedListener(new Teȍ
                            链接地址: http://www.djcxy.com/p/16610.html
                            

    上一篇: 删除视图键盘

    下一篇: 如何隐藏小键盘而无需单击后退按钮