0

Possible Duplicate:
How can my android app detect a dropped call?
Detecting outgoing call and call hangup event in android

I'm making an app that needs to start an intent when a call ends, but I dont know how to do so, i used this in a Call Reciver to track a new call:

    telephony.listen(imPhoneListener, PhoneStateListener.LISTEN_CALL_STATE);
Community
  • 1
  • 1
Theter
  • 15
  • 1
  • 6

2 Answers2

1

Simply when the radio state goes back to idle. But you cannot detect if the connection was not established.

rekire
  • 47,260
  • 30
  • 167
  • 264
1

use TelephonyManager

public void onCallStateChanged(int state, String incomingNumber) {
                String stateString = "N/A";
                switch (state) {
                case TelephonyManager.CALL_STATE_IDLE:
                    stateString = "Idle";
                    break;
                case TelephonyManager.CALL_STATE_OFFHOOK:
                    stateString = "Off Hook";
                    break;
                case TelephonyManager.CALL_STATE_RINGING:
                    stateString = "Ringing";
                    break;
                }

                System.out.println("state-:: " + stateString);
            }
MAC
  • 15,799
  • 8
  • 54
  • 95