I am trying to capture app switch key and home key on android 3.1 and 4.0 but it doesn't seem like its working.
here is what I am doing
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if (KeyCode == KeyEvent.KEYCODE.KEYCODE_APP_SWITCH && event.getRepeatCount() == 0)
{
Log.d ("onkeydown","app switch key");
}
else if (KeyCode == KeyEvent.KEYCODE.KEYCODE_HOME && event.getRepeatCount() == 0)
{
Log.d ("onkeydown","home key");
}
//EDIT:
return super.onKeyDown(keyCode, event);
}
My log.d statement is not printed. Is it possible to capture these 2 keys?
updated code with correct return statement