Hi,
I want to handle key press and long key press for the key code
KEYCODE_CALL(dial button). can any one suggest me how this in android
1.5(API level 3).
Here is the code, but this is not working, for the long key press i am
getting as a normal key event also.
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_CALL: {
if(0 == event.getRepeatCount()) {
// normal key press
// But problem is, this code is hitting for long
press also, how to avoid this
} else {
// Long key press
}
// Always consume CALL to be sure the PhoneWindow
won't do
// anything with it
return true;
}
}
return super.onKeyDown(keyCode, event);
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
To unsubscribe from this group, send email to
android-developers+unsubscribegooglegroups.com or reply to this email with the
words "REMOVE ME" as the subject.