9.3 Technologies Overview

This section introduces the features you’ll use to build the Address Book app.

9.3.1 Displaying Fragments with FragmentTransactions

In earlier apps that used Fragments, you declared each Fragment in an Activity’s layout or, for a DialogFragment, called its show method to create it. The Flag Quiz app demonstrated how to use multiple activities to host each of the app’s Fragments on a phone device, and a single Activity to host multiple Fragments on a tablet device.

In this app, you’ll use only one Activity to host all of the app’s Fragments. On a phone-sized device, you’ll display one Fragment at a time. On a tablet, you’ll always display the Fragment containing the contact list and display the Fragments for viewing, ...

Get Android How to Program, 3/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.