Making POIApp compatible with Android tablets
We have already covered a lot of ground on the fragment basics and life cycle in Chapter 1, The Anatomy of an Android App. I recommend that you read the concepts if you haven't gone through them already. Let's now go through the steps to create and manage fragments and build the POIApp
to support the multi-pane tablet layout.
Currently, the POIApp
is using two activities: POIListActivity
for displaying the list of POIs, and POIDetailsActivity
for displaying the details. Now we will create two new fragments: POIListFragment
and POIDetailFragment
, which will be reused for both the smart phone and multi-pane tablet layout:
Notice the following points in the preceding screenshot, which will be implemented in the rest of the sections in this chapter:
The phone layout contains two activities;
POIListActivity
andPOIDetailsActivity
, that hostPOIListFragment
andPOIDetailFragment
respectively. Here, the activities will work like placeholders to hold fragments...