O'Reilly logo

Android User Interface Development by Jason Morris

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

  1. 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
    
  2. Open the res/layout/main.xml layout resource in an editor or IDE.
  3. Remove the default content within the LinearLayout element.
  4. Add a new TextView object ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required