Soft input keyboard not visible in Android

Possible Duplicate:
Close/hide the Android Soft Keyboard

I used the following code to hide the default keyboard to bring up my own and it works fine

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);

But now when I use the following on the click of a button, the soft keyboard does not reappear. Why?

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);

尝试这个

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,
InputMethodManager.HIDE_IMPLICIT_ONLY);
链接地址: http://www.djcxy.com/p/16608.html

上一篇: 如何隐藏小键盘而无需单击后退按钮

下一篇: 软输入键盘在Android中不可见