views:

18

answers:

1

Hi friends,

Whenever user presses the Search hard key on device, Android it brings out the Quick Search Bar. I want to disable QSB. How to do it, please help.

Thanks in advance.

Updates: Solution

I override the method onSearchRequested() and returned true from there. This completely disabled the Quick Search Bar (QSB).

A: 

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 Lin
Thanks buddy. But I have found a better solution. I have overridden the method onSearchRequested() and returned true from there.
Mudassir