我想设计一个应用程序,我想在一段特定时间后结束传入/传出呼叫。我正在使用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;
}
}
}