I'm developing a Home Screen Launcher App for Android.
Now, if the user is already on the homescreen,
i want a custom action when the user presses the the homebutton.
I know some other launchers, that can override the homebutton,
for example Go Launcher Ex.
My code is:
@Override
public boolean dispatchKeyEvent(KeyEvent event)
{
int action = event.getAction();
int keyCode = event.getKeyCode();
switch (action)
{
case KeyEvent.ACTION_DOWN:
switch (keyCode)
{
case KeyEvent.KEYCODE_HOME:
break;
}
break;
case KeyEvent.ACTION_UP:
switch (keyCode)
{
case KeyEvent.KEYCODE_HOME:
if (!event.isCanceled())
Log.i("TEST", "HOME");
break;
}
break;
}
return super.dispatchKeyEvent(event);
}
But when i press the homebutton, nothing happens..