How to block "Google Search" appearing when long pressed HOME key?

I'm developing a Home screen application for android. But when the HOME key is long pressed "Google Now" search always appears - I want to avoid that. I found that the android framework does not give a HOME key press event out to application level.

Since this is a home screen app I can detect HOME key short press, but not the long press. So how can I block/disable this system search activity coming up when HOME key is long pressed?


也许这篇旧文章(2012/09,Android 4.1.1)可以帮助你:

public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);

    Log.d("Focus debug", "Focus changed !");

    if(!hasFocus) {
        Log.d("Focus debug", "Lost focus !");

        Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
        sendBroadcast(closeDialog);
    }
}
链接地址: http://www.djcxy.com/p/26176.html

上一篇: 按Home键并重新初始化应用程序

下一篇: 长按HOME键时如何阻止“Google搜索”出现?