How do I dismiss the keyboard when a button is pressed?
you can also use this code on button click event
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);