Skip to content

Instantly share code, notes, and snippets.

@vuhung3990
Created September 24, 2014 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vuhung3990/639e4a0328a246e53be1 to your computer and use it in GitHub Desktop.
Save vuhung3990/639e4a0328a246e53be1 to your computer and use it in GitHub Desktop.
public static void hideSoftKeyboard(Activity activity) {
InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment