public static void closeKeyboard ( Context context , View field ) { try { InputMethodManager imm = ( InputMethodManager ) context . getSystemService ( Context . INPUT_METHOD_SERVICE ) ; imm . hideSoftInputFromWindow ( field . getWindowToken ( ) , 0 ) ; } catch ( Exception ex ) { Log . e ( "Caffeine" , "Error occurred trying to hide the keyboard. Exception=" + ex ) ; } }
Go away keyboard nobody likes you .