catching the KEYCODE_ENDCALL event

473 views
Skip to first unread message

mystic-d

unread,
May 21, 2008, 1:03:38 PM5/21/08
to Android Developers
hey
someone know how can i catching the KEYCODE_ENDCALL and KEYCODE_HOME
event ?

i try to override the 'onKeyDown' method of activity like the next
code , but i cant catch the events

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_ENDCALL || keyCode ==
KeyEvent.KEYCODE_HOME) {
Log.d("ATS", "" + keyCode);
}
return true;
}

Thanks !

Megha Joshi

unread,
May 22, 2008, 2:48:45 PM5/22/08
to android-d...@googlegroups.com
Hi,

You can't intercept the home key and the end call key.  This is because the users need to rely on the default behavior of these keys, and its not good for individual applications to change alter that.

-Megha
Reply all
Reply to author
Forward
0 new messages