I tried to show the keyboard after inflating LinearLayout and calling setContentView, for example:
InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); mgr.showSoftInput(etContent, InputMethodManager.SHOW_FORCED); getContent.requestFocus();
This did not work. I also tried this:
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
But that didn't work either. How to make the keyboard show / hide? What have I done wrong?
Damir
source share