I am new to Android development. My requirement is that I want to hide the android virtual keypad when I click on the outside of an EditText widget. Please help.
To hide the virtual keyboard you can execute the following code:
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);
Simply put that code inside the onTouchDown()
method of an OnTouchListener
that is tied to the parent layout.