is there a way to catch call button? the value in log cat said its
5... but when pressing this button my activity can't detect the
keydown of this button:
Here is the code I'm using:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
Log.d("KeyCode", keyCode + " " + event.getKeyCode() + " " +
event.getDisplayLabel());
try {
if (keyCode == KeyEvent.KEYCODE_CALL) {
Log.d("KeyCode", "CALL");
answerPhoneAidl(myContext);
return true;
} else if (keyCode == KeyEvent.KEYCODE_ENDCALL) {
Log.d("KeyCode", "ENDCALL");
endPhoneAidl(myContext);
return true;
}
return super.onKeyDown(keyCode, event);
} catch (Exception e) {
Log.d("Debug", e.toString()); }
}
return true;
}
Please help I just want to detect if the call button is pressed.
Thanks.
--
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