Question

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?

Was it helpful?

Solution

In order to completely disabled the Quick Search Bar, override the method onSearchRequested()and return true unconditionally.

OTHER TIPS

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);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top