Reputation: 315
I want to dial a phone number, and have a message that says "Calling..." while the phone is ringing.
Then, when the phone is connected, I want my activity to display a timer (chronometer) that will count as soon as the call is active.
Then when the call ends, a message will be displayed saying the call has ended.
Can I place a call and stay on my current activity screen so that I can implement these features?
Upvotes: 0
Views: 354
Reputation: 1350
The short answer is no. The Telephony interface in android is locked down pretty hard as of Gingerbread, thus making it pretty much impossible to do anything with the during call states.
To try it out you could implement the PhoneStateListener, which is pretty well described in this thread and maybe you can come to your solution another way. You could have your activity implement the phone state listener and start a timer, and then when the call is finished bring the user back to your activity. But you will find its quite impossible to keep them in your activity during the call.
Upvotes: 1