0

Possible Duplicate:
overriding the Home Key Long press in a category.HOME activity

Does anyone know the name of the method triggered by a long press on the home button in the 2.3.3 android source?

Community
  • 1
  • 1
MademoiselleLenore
  • 569
  • 1
  • 10
  • 25
  • 1
    You mean the name of the method that's called by the operating system? That doesn't sound like useful information. – keyser Oct 10 '12 at 15:49

1 Answers1

0

Home Button is Reserved By Android OS. Events triggered upon the Android UI Components Only. You cannot trigger the long press event upon the Home Button. If you want to trigger event for Home button, you should Handle using key Events method.

Example :

@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
    if(keyCode == KeyEvent.KEYCODE_BACK)
    {
        Log.d("Test", "Back button pressed!");
    }
    else if(keyCode == KeyEvent.KEYCODE_HOME)
    {
        Log.d("Test", "Home button pressed!");
    }
    return super.onKeyDown(keyCode, event);

}

RajeshVijayakumar
  • 10,281
  • 11
  • 57
  • 84
  • Thanks rajeshmcashc10 and my apologies if I didn't make myself clear. I'm actually customizing a ROM because I can't use keyListeners in the application (mostly running background). I need to change the behaviour of the home button on long-press (the application won't be on the market and concerns a specific device). If anyone has a hint for me, that would be great... – MademoiselleLenore Oct 10 '12 at 16:39