I want to start a new activity once an outgoing call is activated (NEW_OUTGOING_CALL). However I dont know where I should start my new activity in the PhoneStateListener class that I created (method onCallStateChanged) Where do I start my intent?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;
}
}