Is there a way in Android to detect if the software (a.k.a. \"soft\") keyboard is visible on screen?
I did this as follows, but its relevet only if your goal is to close / open the keyboad.
close example: (checking if keyboard already closed, if not - closing)
imm.showSoftInput(etSearch, InputMethodManager.HIDE_IMPLICIT_ONLY, new ResultReceiver(null) {
@Override
protected void onReceiveResult(int resultCode, Bundle resultData) {
super.onReceiveResult(resultCode, resultData);
if (resultCode != InputMethodManager.RESULT_UNCHANGED_HIDDEN)
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
}
});