我想在激活拨出电话后启动新活动(NEW_OUTGOING_CALL)。但是我不知道我应该在我创建的PhoneStateListener类中启动新活动的位置(方法onCallStateChanged)我从哪里开始我的意图?CALL_STATE_IDLE?CALL_STATE_OFFHOOK?
public void onCallStateChanged(int state, String incomingNumber) {
switch (state) {
case TelephonyManager.CALL_STATE_IDLE:
Log.d("System out", "IDLE");
NOTOFFHOOK = true;
break;
case TelephonyManager.CALL_STATE_OFFHOOK: method called
Log.d("System out", "OFFHOOK, it flag: " + NOTOFFHOOK);
if (NOTOFFHOOK == false) {
// do your work on receiving call.
}
break;
case TelephonyManager.CALL_STATE_RINGING:
Log.d("System out", "RINGING");
// do your work while ringing.
break;
}
}