Created
July 22, 2016 11:49
-
-
Save nichtemna/ba8637f21da878e9077570f436fa4028 to your computer and use it in GitHub Desktop.
Android toggle keyboard programmaticaly
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
public static void showKeyboard(Context context, View view) { | |
InputMethodManager inputMethodManager =(InputMethodManager)context.getSystemService(Activity | |
.INPUT_METHOD_SERVICE); | |
inputMethodManager.showSoftInputFromInputMethod(view.getWindowToken(), 0); | |
} | |
public static void hideKeyboard(Context context, View view) { | |
InputMethodManager inputMethodManager =(InputMethodManager)context.getSystemService(Activity | |
.INPUT_METHOD_SERVICE); | |
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment