Monday, 1 December 2014

How to dismiss Keypad in Android

17:12:00 Posted by Kumanan

If you want to dismiss the keypad manually through code, you can do that with the following methods:

Call these lines on which EditText you want to dismiss the keypad.


EditText txtEmail = (EditText) findViewById(R.id.inputEmail); 
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(txtEmail.getWindowToken(), 0);