March 2016
Intermediate to advanced
428 pages
9h 2m
English
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 the phone state events.
Create a new project in Android Studio and call it PhoneStateListener. Use the default Phone & Tablet option and select Empty Activity when prompted for Activity Type.
Although it's not required, you can use the previous recipe to initiate a phone call to view the events. ...
Read now
Unlock full access