2

我想设计一个应用程序,我想在特定时间后结束来电/去电。我PhoneStateListener用来听通话的状态变化

public class MyPhoneStateListener extends PhoneStateListener {
          public void onCallStateChanged(int state,String incomingNumber){
          switch(state){
            case TelephonyManager.CALL_STATE_IDLE:
                tIncomingCounter=false;
              Log.i(TAG1, "IDLE"+IncomingCounter);
            break;
            case TelephonyManager.CALL_STATE_OFFHOOK:
                IncomingCounter=true;
              Log.i(TAG1, "OFFHOOK");
            break;
            case TelephonyManager.CALL_STATE_RINGING:

                Log.i(TAG1, "RINGING");
            break;
            }
          } 
        }
4

0 回答 0