Last active
August 29, 2015 14:05
-
-
Save panpf/477f60a6550220b085b9 to your computer and use it in GitHub Desktop.
Android - 关闭软键盘
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 关闭软键盘 | |
* @param activity | |
*/ | |
public static void closeSoftInput(Activity activity){ | |
InputMethodManager methodManager = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE); | |
methodManager.hideSoftInputFromWindow(activity.getWindow().getDecorView().getWindowToken(), 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment