I am new to android, I have a small doubt regarding how to handle the hardware Keyboard and if I click the search button in any part of my application it should be handled means I need to pass the intent of search activity?
How I can reach this goal.
The hardware back button is found on most Android devices. In native applications it can be used to close modals, navigate to the previous view, exit an app, and more. By default in Ionic, when the back button is pressed, the current view will be popped off the navigation stack, and the previous view will be displayed.
OS buttons are reserved for system actions: turning power on and off, and launching apps. All Wear OS watches have a power button and a launcher button.
Try this,
@Override
public boolean onSearchRequested() {
// your stuff here
return false;
}
It will also trigger onKeyDown
with a keyCode of KeyEvent.KEYCODE_SEARCH
before calling onSearchRequested
as stated above
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With