Book Image

Xamarin Mobile Application Development for Android, Second Edition

Book Image

Xamarin Mobile Application Development for Android, Second Edition

Overview of this book

Table of Contents (18 chapters)
Xamarin Mobile Application Development for Android Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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:

  1. 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...