Time for action - viewing phone book contacts
In this example we will delve a little deeper into the workings of the Android system. We're going to override the default "view contact" option, providing our own
Activity to view contacts from the phonebook on the device. When the user tries to open a contact to e-mail or call them, they will be presented with an option to view the contact using our
Activity instead of the default one.
- Start by creating a new project from the command line:
android create project -n ContactViewer -p ContactViewer -k com.packtpub.contactviewer -a ViewContactActivity -t 3
- Open the
res/layout/main.xmllayout resource in an editor or IDE.
- Remove the default content within the
- Add a new