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 the list fragment for displaying the POI list


So far, we have created a fragment using the Fragment subclass to display the details of the point of interest. Let's now use a specialized ListFragment class to create a new fragment to display the POI list fetched from the server.

Understanding ListFragment

Before we start creating the POIListFragment, let's understand the following key concepts of ListFragment:

  • ListFragment is a specialized Fragment subclass used to display the list of items from different data sources, such as an array or a cursor, that hold the query results.

  • ListFragment provides a default layout that contains a single list view. However, it can be customized using your own custom layout.

  • While using a custom layout for ListFragment, your layout must contain a ListView object with the ID @android:id/list.

  • Like the normal ListView, the list fragment needs the instance of an adapter to operate on. It exposes a public ListAdapter property to set the list adapter.

  • You can...