How to determine that the “End” button is pressed on an incoming call to disconnect

I use PhoneStateListener to detect the status of a call, but I want to fire an event when the user clicks the End button to disconnect the call. From PhoneStateListener we can access only the three states Call_State_IDLE , Call_State_RINGNG , call_State_OFFHOOK , and the Call_State_IDLE event is triggered or when the user uses it, end the call or the caller stops the call.

And I also want to find out if the caller ends calls in the middle.

+3
source share
1 answer

You can find out that the user has completed the call when the state of the phone goes to IDLE. u can fire the event you want when PHONE_STATE goes to CALL_STATE_IDLE.

0
source

All Articles