Skip to content Skip to sidebar Skip to footer

How To Disable Qsb..?

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?

Solution 1:

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

Solution 2:

override onKeyDown in your activity:

@OverridepublicbooleanonKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_SEARCH) {            
        returntrue;
    } elsereturnsuper.onKeyDown(keyCode, event);
}

Post a Comment for "How To Disable Qsb..?"