O'Reilly logo

Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android by Michael Eierman, Jakob Iversen

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

Create the Layout

Now that you have a way to get contact data, the next step is to modify the activity_contact_list.xml file to include a ListView widget. Open this file and delete the HelloWorld TextView if you have not already done so (see creating the layout in the “Using Preferences” section of Chapter 5, “Persistent Data in Android”). Also add the navigation bar if you haven’t done that. Be sure to delete the paddingLeft, attributes, and the like in the root RelativeLayout. In Graphical Layout, from the Composite folder in the Palette, drag a ListView to anywhere on the layout. Switch to activity_contact_list.xml and modify the XML for the ListView widget to match Listing 6.2.

Listing 6.2 ListView XML

<ListView ...

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