Hooking up POIListViewAdapter
We have the list layout and adapter ready; let's now proceed to hook up the data in poiListView
. We need to switch back to the POIListActivity
class and add the following changes:
- Declare the following variables inside the
POIListActivity
class:private ListView poiListView; private ProgressBar progressBar; private List<PointOfInterest> poiListData; private POIListViewAdapter poiListAdapter;
- Now, in the
OnCreate
method, instantiate theListView
andProgressBar
:poiListView = FindViewById<ListView> (Resource.Id.poiListView); progressBar = FindViewById<ProgressBar> (Resource.Id.progressBar);
- For now, we will create an
Async
method that is responsible for downloading the data from the server and displaying it inPOIListActivity ...
Get Xamarin Mobile Application Development for Android - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.