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.
Before we start creating the POIListFragment
, let's understand the following key concepts of ListFragment
:
ListFragment
is a specializedFragment
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 aListView
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 publicListAdapter
property to set the list adapter.You can...