Populating the ListView item

There are a number of ways to populate a ListView item within the Android platform; they all work with some type of adapter, meaning a subtype of BaseAdapter or some type of class that implements the IListAdapter interface. For simple lists, you will commonly see the use of ArrayAdapter<T>.

We will create a subtype of BaseAdapter<T> as it meets our specific need, works well in many scenarios, and allows for the use of our custom layout.

Shared instance of IPOIDataService

Prior to creating the adapter, we need to consider how we will get access to an instance of the data service since it will be the source of our POI data. As you may recall from Chapter 4, Creating a Data Storage Mechanism, we simply created an instance ...

Get Xamarin Mobile Application Development for Android now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.