开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜