How to track the down arrow button in virtual keyboard?

后端 未结 2 1504
慢半拍i
慢半拍i 2021-01-13 01:36

\"enter

In the above figure i want to listen for down arrow( i have mar

相关标签:
2条回答
  • 2021-01-13 02:04

    In your activity, override this method: http://developer.android.com/reference/android/app/Activity.html#onBackPressed()

    0 讨论(0)
  • 2021-01-13 02:28

    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;
    }
    
    0 讨论(0)
提交回复
热议问题