开发者

How to disable QSB..?

When a user p开发者_运维百科resses the Search hard key on the device, Android shows the Quick Search Bar. How do I disable the Quick Search Bar?


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);
}


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜