android - outgoing call answered in PhoneStateListener -
I'm tracking an outgoing call in Android, but I should know when the phone call was answered.
I have a android.intent.action.NEW_OUTGOING_CALL receiver that gives me a user-dialed phone number.
I also use call code PhoneStateListener , so I have the code mentioned above, code
CALL_STATE_RINGRING ,
CALL_STATE_OFFHOOK and
CALL_STATE_IDLE
To identify an incoming call: Get the first I
CALL_STATE_RINGING only if the call was answered - I found
CALL_STATE_OFFHOOK
CALL_STATE_IDLE .
But outgoing calls always get me
CALL_STATE_OFFHOOK , then
CALL_STATE_IDLE - no matter if the call has been answered or not ...
So how can I know that / when the outgoing call was answered?
Thanks
OK, I did something sort of solution:
When I get CALL_STATE_IDLE - I repeatedly schedule a timer for 500 ms, and Android. the provider. Check out the call. Calls. CONTENT_URI
I previous call is done with outgoing phone number, and once I found it - I can get the time.
It normally takes approximately 300-700 MS, so I have a 0.5 - 1 second delay. ..
Comments
Post a Comment