1public static void hideSoftKeyboard(Activity activity) {
2 InputMethodManager inputMethodManager =
3 (InputMethodManager) activity.getSystemService(
4 Activity.INPUT_METHOD_SERVICE);
5 inputMethodManager.hideSoftInputFromWindow(
6 activity.getCurrentFocus().getWindowToken(), 0);
7}