final RelativeLayout view = (RelativeLayout)findViewById(R.id.activity_loading); view.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() { @Override public void onGlobalLayout() { if ((view.getRootView().getHeight() - view.getHeight()) > view.getRootView().getHeight()/3) { // keyboard is open } else { // keyboard is closed } } });
Fai RIRERE!
ReplyDeleteGreat thanks!!!
ReplyDeleteWon't work with modern keyboards, which can be less than 1/3 of screen height or even float around the window.
ReplyDeleteSuperrrrrrr.................Thank you
ReplyDeleteThanks for a brilliant solution!!!
ReplyDelete