0

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.

  • you can check my answer here regarding detecting keyboard ... http://stackoverflow.com/a/15382151/931982 – stinepike Apr 19 '13 at 10:33
  • Exact duplicate of [question](http://stackoverflow.com/questions/16102298/how-to-detect-popping-up-of-keyboard) – flexdroid Apr 19 '13 at 10:36

1 Answers1

0

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);
                        }
                    });
Imran Ali
  • 539
  • 4
  • 17