tags:

views:

753

answers:

2

My Query is, I want to get notified if the receiver at the other side picks my call when I am making an outgoing call, Is it possible with the Android SDK.

The onCallStateChanged Function is called only when the Person dial a number(OFFHOOK), from his phone and When the call reciever person disconnects the call(IDLE), But there is

no State parameter to knowthat, does the other end person has recieved the call??

public class MyPhoneStateListener extends PhoneStateListener{

    public void onCallStateChanged(int state,String incomingNumber){

        Log.d("Checking---->",TelephonyManager.ACTION_PHONE_STATE_CHANGED);


      }
}

Logcat give only the following information when call recieved at the other side:

01-19 19:33:30.633: DEBUG/CallNotifier(638): stopRing()... (OFFHOOK state)
01-19 19:33:30.662: DEBUG/Ringer(638): stopRing()...
01-19 19:33:30.694: DEBUG/Ringer(638): - stopRing: null mRingHandler!
01-19 19:33:31.256: DEBUG/PhoneApp(638): updateWakeState: callscreen true, dialer false, speaker false...
01-19 19:33:31.287: DEBUG/PhoneApp(638): updateWakeState: keepScreenOn = false (isRinging false, showingDisc false)
A: 

Use a PhoneStateListener or watch for ACTION_PHONE_STATE_CHANGED broadcast Intents to be notified of when the phone state changes.

CommonsWare
But I cant get control Over that state, In the Logcat only I can see is the CallNotifier is called,Do I need to register any receiver for this?? please suggest.
Vinayak.B
You cannot have control over the state.
CommonsWare
Then is there any relevant way to notify through a application that user has picked up the phone on the other side.Or atleast the application come to know that the phone has picked up by the user at the other end so that it can perform some functionality.
Vinayak.B
As I wrote above, use a PhoneStateListener or watch for ACTION_PHONE_STATE_CHANGED broadcast Intents to be notified of when the phone state changes.
CommonsWare