I need to do a very simple thing - find out if the software keyboard is shown. Is this possible in Android?
The idea is, if you need to hide your keyboard and check soft input state at the same time, use the following solution:
public boolean hideSoftInput() {
InputMethodManager imm = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE);
return imm.hideSoftInputFromWindow(mViewPager.getWindowToken(), 0);
}
This method returns true if keyboard was shown before hiding.