My application works with remote Bluetooth keyboard. I have defined some predefined custom implementation on arrow keys and enter key. I want to perform only those actions whenever user press arrow key or Enter Key in my application.
But sometimes it is still showing default behavior of keys.
My Current Code is as follows
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_DPAD_UP) {
// my custom work
return true;
}else{
return super.onKeyUp(keyCode, event);
}
}
any idea, how I can restrict default behavior of arrow keys and enter key?
Thanks
Use below code: