检测键盘android系统键盘、系统、android

由网友(天使的微笑)分享简介:我有包含安装的应用程序列表,并发动他们click.In我的应用程序使用Intent.ACTION_CLOSE_SYSTEM_DIALOG广播用于关闭系统对话框,如任务管理器(近期应用程序对话框),电源选项对话框,低电池项目android应用对话框等等....但是这个隐藏键盘在一些devices.I想确保用户无法最近应用...

我有包含安装的应用程序列表,并发动他们click.In我的应用程序使用Intent.ACTION_CLOSE_SYSTEM_DIALOG广播用于关闭系统对话框,如任务管理器(近期应用程序对话框),电源选项对话框,低电池项目android应用对话框等等....但是这个隐藏键盘在一些devices.I想确保用户无法最近应用程序对话框,我applications.How我可以关闭除键盘系统对话框进行交互?我如何检查是否显示键盘还是不?是有可能发现最近的应用程序对话框?我被困在此的hours.Any帮助绝AP preciating。

I have an android application which contain list of installed applications and launch them on item click.In my application I used Intent.ACTION_CLOSE_SYSTEM_DIALOG broadcast for closing system dialogs such as Task Manager(Recent Apps dialog),Power Option dialog,Low battery dialog etc....But this hides keyboard in some devices.I want to make sure that the user could not interact with recent apps dialog from my applications.How can i close system dialogs except keyboard?How can i check whether the keyboard visible or not?Is it possible to detect Recent Apps dialog?I am stuck on this for hours.Any help must appreciating.

推荐答案

我用这个code检测键盘。

I've used this code to detect keyboard.

view.getViewTreeObserver().addOnGlobalLayoutListener(
                new OnGlobalLayoutListener() {

                    @Override
                    public void onGlobalLayout() {


                            int heightDiff = 

view.getRootView().getHeight()
                                    - view.getHeight();
                            if (heightDiff > 200) {
                                keyboardUp = true;

                                return;
                            }
                            if (keyboardUp) {
                                keyboardUp = false;

                            }
                            Log.e("Keyboard", "" + keyboardUp);
                        }
                    });
阅读全文

相关推荐

最新文章