Created
July 3, 2017 15:16
-
-
Save wszdwp/19e6cadb67419057f7564b3063678593 to your computer and use it in GitHub Desktop.
Hide soft keyboard in android
This file contains hidden or 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
private void hideSoftKeyBoard() { | |
final View myCurrentFocusView = getCurrentFocus(); | |
myCurrentFocusView.postDelayed(new Runnable() { | |
@Override | |
public void run() { | |
// TODO Auto-generated method stub | |
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); | |
imm.hideSoftInputFromWindow(myCurrentFocusView.getWindowToken(), 0); | |
} | |
},100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment