Please teach me how to hide my Android virtual keyboard ㅠㅜ

Asked 2 years ago, Updated 2 years ago, 147 views

There are EditText and buttons in the layout that I made I want to hide my virtual keyboard when I write Edit Field and click the button What do I do?

android keyboard android-softkeyboard android-keypad android-input-method

2022-09-21 22:11

1 Answers

You can control virtual keyboards with the InputMethodManager class.

    View view = this.getCurrentFocus();
    if (view != null) {  
        InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
    }

This will allow you to hide your keyboard.


2022-09-21 22:11

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.