Hide keypad in android while touching outside Edit Text Area

Viewed 18785

I know that the code for dismiss tyhe keypad in android is

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);

Can anyone suggest me a method to hide the keypad if we touch the area outside the text area other than the keypad in the screen.

3 Answers
Related