Challenge: Another Implicit Intent
Instead of sending a crime report, an angry user may prefer a phone confrontation with the suspect. Add a new button that calls the named suspect.
You will need the phone number out of the contacts database. This will require you to query another table in the ContactsContract database called CommonDataKinds.Phone. Check out the documentation for ContactsContract and ContactsContract.CommonDataKinds.Phone for more information on how to query for this information.
A couple of tips: To query for additional data, you can use the
This is a runtime permission, so you need to explicitly ask the user’s permission to access their contacts. If you would like to ...