When a user presses the Search hard key on the device, Android shows the Quick Search Bar. How do I disable the Quick Search Bar?
Asked
Active
Viewed 539 times
2 Answers
1
override onKeyDown in your activity:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_SEARCH) {
return true;
} else return super.onKeyDown(keyCode, event);
}

Mathias Conradt
- 28,420
- 21
- 138
- 192
-
1Thanks buddy. But I have found a better solution. I have overridden the method onSearchRequested() and returned true from there. – Mudassir Oct 27 '10 at 03:05
1
In order to completely disabled the Quick Search Bar, override the method onSearchRequested()
and return true unconditionally.

Mudassir
- 13,031
- 8
- 59
- 87