1

I would like to know if there is a way to ckeck if incoming call was ended by the user (dropped) or ended automatically because there wasn't a response (missed call). In other words: I want to do some action the moment when there appears a missed call (when the call is ended automatically).

tshepang
  • 12,111
  • 21
  • 91
  • 136
Salivan
  • 1,876
  • 7
  • 26
  • 45

1 Answers1

1

Do Something like that when missed call is appeared. In my code i open activity when missed call appeared.

switch (state) {
    case TelephonyManager.CALL_STATE_IDLE:
        Log.v("idle state", "CALL_STATE_IDLE");

        // CALL_STATE_IDLE ( OpenMissedCallScreen )


        if (ring == true && callReceived == false && CheckMissCall.isRunning== false) {



            flag = true;
            if (prefs.getBoolean("main_state", true))
            {
                Intent inter = new Intent(c, MissCall.class);

            }

        }



        break;
    case TelephonyManager.CALL_STATE_OFFHOOK:

        // CALL_STATE_OFFHOOK ( OpenReceivedCallScreen )
        callReceived = true;



        break;
    case TelephonyManager.CALL_STATE_RINGING:

        ring = true;
        // CALL_STATE_RINGING ( openIncomingCallScreen )


        break;