Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void hideKeyboard(Activity context) {
- View currentFocus = context.getCurrentFocus();
- if (currentFocus != null) {
- InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
- if (imm != null) {
- imm.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement