Updating the POIApp to support the multi-pane split layout
In an Android tablet, the POI activity layout is declared to host both the POI list and POI details fragments by sharing the same screen space. The POIListFragment
is statically added to the layout, and POIDetailFragment
will be added dynamically when a user selects any POI item from the list. The FrameLayout
with the detailsLayout
ID is used as a placeholder to host the POIDetailFragment
. However, in mobile devices, when a user clicks on any POI list item, it will continue to start POIDetailActivity
.
The following steps will take you through the changes required to make the POIApp
work for the multi-pane layout in Android powered tablets:
First, we need to find out if the device is running in the multi-pane mode. This is useful in order to understand whether you want to start a new activity or update the fragment content in the same activity. Let's declare a static Boolean variable that holds the information about whether or not an...