Code example for View

Methods: getKeyDispatcherState

0
            } else if (event.getAction() == KeyEvent.ACTION_UP && !event.isCanceled()) {
                Window win = mDialog.getWindow();
                if (win != null) {
                    View decor = win.getDecorView();
                    if (decor != null) {
                        KeyEvent.DispatcherState ds = decor.getKeyDispatcherState();
                        if (ds != null && ds.isTracking(event)) {
                            mMenu.close(true);
                            dialog.dismiss();
                            return true; 
                        } 
                    } 
                } 
            } 
        } 
 
        // Menu shortcut matching 
        return mMenu.performShortcut(keyCode, event, 0);
 
    } 
Experience pair programming with AI  Get Codota for Java