Code example for KeyEvent

Methods: getActiongetRepeatCount

0
                                        int movementMetaState, KeyEvent event) {
        switch (keyCode) {
            case KeyEvent.KEYCODE_DPAD_CENTER:
            case KeyEvent.KEYCODE_ENTER:
                if (KeyEvent.metaStateHasNoModifiers(movementMetaState)) {
                    if (event.getAction() == KeyEvent.ACTION_DOWN &&
                            event.getRepeatCount() == 0 && action(CLICK, widget, buffer)) {
                        return true; 
                    } 
                } 
                break; 
        } 
        return super.handleMovementKey(widget, buffer, keyCode, movementMetaState, event);
    } 
 
    @Override 
    protected boolean up(TextView widget, Spannable buffer) {
        if (action(UP, widget, buffer)) {
            return true; 
        }