Code example for KeyEvent

Methods: getKeyCode

0
 
        // From http://stackoverflow.com/a/4390592/328679 
        // TODO: Consider this from the comments: 
        // "I am getting reports from Android users with Hardware keyboards that 
        // doing this somehow interferes with key presses." 
        if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
 
            if (mListener != null) {
                if (mListener.onBackButtonPressed() == true) {
                    return true; 
                } 
            } 
        } 
        return super.dispatchKeyEvent(event);
    } 
 
    /* 
     * 
	 */ 
    public interface EditClearTextListener {