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?
How to disable QSB..?
In order to completely disabled the Quick Search Bar, override the method onSearchRequested()
and return true unconditionally.
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);
}
Thanks buddy. But I have found a better solution. I have overridden the method onSearchRequested() and returned true from there. –
Marrin
In order to completely disabled the Quick Search Bar, override the method onSearchRequested()
and return true unconditionally.
© 2022 - 2024 — McMap. All rights reserved.