how to listen callee hangup call event?

Put your problem here if it does not fit any of the other categories.

how to listen callee hangup call event?

Postby Hex » Sun Oct 26, 2008 8:30 am

Hi:
Now ,I can use PhoneStateListener to listen some incoming call state
event.
here is the code:

Code: Select all
       public void onCallStateChanged(int state, String incomingNumber) {
               Log.v(TAG, "onCallStateChanged(), Incoming Number: " +
incomingNumber);

               super.onCallStateChanged(state, incomingNumber);

               switch (state) {
// user hangup call
               case TelephonyManager.CALL_STATE_IDLE:
                       Log.i(TAG, "CALL_STATE_IDLE");
                       break;
               case TelephonyManager.CALL_STATE_OFFHOOK:
// user pickup call
                       Log.i(TAG, "CALL_STATE_OFFHOOK");
                       break;
               case TelephonyManager.CALL_STATE_RINGING:
// imcoming call
                       Log.i(TAG, "CALL_STATE_RINGING");
                       break;
               default:
                       Log.w(TAG, "unknown call state: " + state);
               }
       }


As you know ,TelephonyManager.CALL_STATE_IDLE can deal with hangup
event, but I do not know who hangs up the call, the callee? the
caller? ,so,can anyone give me some message about this?
thanks in advance.
Hex
Freshman
Freshman
 
Posts: 4
Joined: Sun Oct 19, 2008 3:13 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 27 guests