Code example for KeyEvent

Methods: getActiongetEventTime

0
        if (keyCode != KeyEvent.KEYCODE_DPAD_CENTER
                || event.getAction() != KeyEvent.ACTION_UP) {
            // Log.i(TAG, "getting out of dodge..."); 
            return false; 
        } 
 
        // Log.i(TAG, "Clicked mKeyguard! dimissing dialog"); 
        this.dismiss();
        // Log.i(TAG, "onKey: turning off the screen..."); 
        // XXX: arve says this is a hack for now 
        mPowerManager.goToSleep(event.getEventTime() + 1);
        return true; 
    } 
 
    public void show() { 
        super.show(); 
        Log.d(TAG, "show... disabling expand");
        sStatusBar.disable(StatusBarManager.DISABLE_EXPAND);
    } 
 
    public void dismiss() {