In the previous recipe, we demonstrated how to make a phone call, both with an Intent to call the default application, as well as by directly dialing the number with no UI.
What if you want to be notified when the calls ends? This is where it gets a bit more complicated, as you'll need to monitor the Telephony events and track the phone state. In this recipe, we'll demonstrate how to create a PhoneStateListener to read phone state events.