Can someone explain why the soft keyboard appears and disappears when it does?
I have a layout with many different controls, mostly EditTexts and Buttons. When I first show this page, the EditText at the top of the layout has focus, and the soft keyboard closes the bottom 45% of the screen.
I assumed that the keyboard was there because EditText had focus, so I decided to give a button at the bottom of my page, and focus instead.
butDone.setFocusableInTouchMode(true); bResult = butDone.requestFocus();
... right after setContentView (). This worked the same as pressing a button. Bobton got the focus, and EditText no longer focused, but the keyboard was still there. In the end, I got rid of the keyboard through
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
but itβs clear that my theory that EditText has focus was wrong. So can someone explain the βrulesβ about what makes the keyboard appear when it does, or a link to these rules? Thanks in advance!
source share