How to track down arrow button on virtual keyboard?

enter image description here

In the above figure, I want to listen to the down arrow (I marked it in red, the key that is used to hide the keyboard). I tried to get its action through menu options, display configuration class, etc. But this is not useful. Is there a way, listeners, or any callback event to track this button. Please let me know your suggestions and thoughts. Any help in this regard is very noticeable.

Thanks inAdvance

+5
source share
2 answers

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;
}
-2

All Articles