1

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);
Community
  • 1
  • 1
Aakash Anuj
  • 3,773
  • 7
  • 35
  • 47

1 Answers1

1

Try this

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,
InputMethodManager.HIDE_IMPLICIT_ONLY);
kumar_android
  • 2,273
  • 1
  • 21
  • 30