How to track the down arrow button in virtual keyb

2019-02-17 12:08发布

enter image description here

In the above figure i want to listen for down arrow( i have marked it in red colour, the key one which is used to hide the keyboard). I have tried to get it action through menu options, viewconfiguration class etc. But it is not useful. Is there any method, listeners or any callback event to track this button. Please let me know your suggestions and thoughts. Any help in this regard is highly appreciable

Thanks inAdvance

2条回答
\"骚年 ilove
3楼-- · 2019-02-17 12:44

If I am not you talking about this method

public boolean onKeyDown(int keyCode, KeyEvent event) {
super.onKeyDown(keyCode, event);
    switch(keyCode)
    {

    case KeyEvent.KEYCODE_BACK:
     Toast.makeText(KeyActions.this, "Pressed Back Button", Toast.LENGTH_SHORT).show();

        return true;
    }

    return false;
}
查看更多
登录 后发表回答