I'm trying to listen for the search key, I've found two solutions on stackoverflow but neither works with the search button for some reason.
@Override
public boolean onSearchRequested() {
System.out.println("KEYDOWN");
return true;
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
System.out.println("KEYDOWN");
return true;
}
As you can see the first one just the search intent and the second option should catch all keydowns regardless the key, onKeyDown is working correctly for all keys (back, menu and volume keys in my phone) in my Nexus S but simply doesn't catch the search key. People seem to be pretty sure any of this options should work there is even an approved where onSearchRequested is suggested but I have tried in two phones and in neither of them works.
How can I catch and disable the search key on android?