How to Hide and Show Soft Keyboard in Android


There may be a case where you want to hide or show the soft keyboard. The case may be for example, you are done with entering text in search view and based on your selection from the suggestion list you want to take some action and also want to close (hide) the soft keyboard. You can hide or show the soft keyboard programmatically in Android by using the InputMethodManager. You can hide and show the keyboard programmatically with the following methods. Call the below methods by passing EditText, SearchView or any view object in it.

Hiding Soft Keyboard

Showing Soft Keyboard

Usage

Enjoy Coding and Share Knowledge





Show Buttons
Hide Buttons