Android: Dynamically close the virtual keypad though code?
How can you dynamically close the virtual keypad through code? All I want to do is close it when the user clicks an "Ok" but开发者_JAVA百科ton because it is not closing itself even though the button now has focus.
Hi i got one more solution to hide keyboard by :
InputMethodManager imm = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
Here pass HIDE_IMPLICIT_ONLY at the position of showFlag and 0 at the position of hiddenFlag. It will forcefully close soft Keyboard.
Close/hide the Android Soft Keyboard
精彩评论