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 513 times
2 Answers
2
In order to completely disabled the Quick Search Bar, override the method onSearchRequested()and return true unconditionally.
Mudassir
- 14,250
- 8
- 62
- 86
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,117
- 20
- 135
- 191
-
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