static void aHideKeyboard() { View view = aActivity().getCurrentFocus(); if (view != null) { InputMethodManager inputManager = (InputMethodManager) aActivity().getSystemService(Context.INPUT_METHOD_SERVICE); inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } }