-5

I have two EditText Views and a Button in Linearlayout. After Completion of writing in the edittext, I want to hide the Android Virtual keyboard, How can I do that?

Lucifer
  • 28,933
  • 23
  • 88
  • 140
shweta_jain
  • 463
  • 1
  • 5
  • 19

1 Answers1

20

You may use the InputMethodManager class like this:

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow( yourEditText.getWindowToken(),InputMethodManager.RESULT_UNCHANGED_SHOWN);
Harmlezz
  • 7,744
  • 25
  • 34
Lucifer
  • 28,933
  • 23
  • 88
  • 140