0

当用户断开呼叫时如何显示选项屏幕?

在此处输入图像描述

4

2 回答 2

0

在此处检查 PhoneStateListener

http://developer.android.com/reference/android/telephony/PhoneStateListener.html

你也可以试试这些教程:

http://www.botskool.com/geeks/how-listen-phone-events-android

http://www.tutorialforandroid.com/2009/01/get-phone-state-when-someone-is-calling_22.html

只需记录所有状态更改以检查挂断时触发的状态。

希望有帮助。:)

于 2012-12-07T05:37:42.760 回答
0

它检测挂断按钮键事件。

  @Override
  public boolean dispatchKeyEvent(KeyEvent event) {
  int keyCode = event.getKeyCode();
  if (event.getAction() == KeyEvent.ACTION_DOWN) {
     if (keyCode == KeyEvent.KEYCODE_ENDCALL) {
        //do your work here
        return true;
     } else {
        return super.dispatchKeyEvent(event);
     }
  }
}
于 2012-12-07T05:41:18.033 回答