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

Using fragments for displaying POIDetails


In order to make things simple, we will move step by step. First, let's create a new fragment to display the details of the POI, and this will enable you to edit, update, and delete the POI. Currently, the POIDetailActivity activity contains the same logic. At this point, let's keep it simple and not complicate things by thinking about the multi-pane tablet layout.

Creating the POIDetailsFragment layout

Let's begin with creating a new layout file for the POI details fragment and name it POIDetailFragment.axml:

  1. Select the Resources/Layout folder in the Solution pad.

  2. Right-click on Add and select New File.

  3. In the New File dialog box, click on Android and select Layout, enter POIDetailFragment in the Name field, and select New.

  4. Note that we will not make any changes to the POI details screen layout. So, let's just copy the layout XML source code from POIDetail.axml and paste it into the newly created POIDetailFragment.axml file.

Creating the POIDetailFragment...