Get soft keyboard height in fullscreen mode

I have a fullscreen activity in which I have some editing area. For Android 4.3 and before, I set fullscreen mode with

activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

In the editing view, I use the method described here to get notified when the soft keyboard visibility changes and also to get its height. Everything works fine.

From 4.4, in order to profit immersive mode, the normal mode is set (when status bar is visible) with:

activity.getWindow().getDecorView().setSystemUiVisibility(
                            View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);

But apparently, the method mentioned above to get soft keyboard height is no longer working with getWindowVisibleFrame() returns always the same rectangle whether the keyboard is visible or not.

Here my question: is there any other way to get soft keyboard state and its height on 4.4 that works with SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN ?

Thanks in advance.

链接地址: http://www.djcxy.com/p/93374.html

上一篇: 如何以编程方式在我的EditText上设置焦点(并显示键盘)

下一篇: 以全屏模式获取软键盘高度