I need to do a very simple thing - find out if the software keyboard is shown. Is this possible in Android?
A method that doesn't need a LayoutListener
In my case, I would like to save the state of the keyboard before replacing my Fragment. I call the method hideSoftInputFromWindow from onSaveInstanceState, which closes the keyboard and returns me whether the keyboard was visible or not.
This method is straightforward but may change the state of your keyboard.