1

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?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • i hope this helps: http://stackoverflow.com/questions/17549478/how-to-disable-home-and-other-system-buttons-in-android – fecub May 08 '14 at 17:20
  • Possible duplicate of [Replace Google Now gesture](http://stackoverflow.com/questions/14233330/replace-google-now-gesture) – CrandellWS Feb 07 '16 at 03:58

1 Answers1

0

Maybe this old article (2012/09, Android 4.1.1) can help you :

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);
    }
}
lbeziaud
  • 312
  • 4
  • 13