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
. Add the following method to thePOIListActivity
class:public async void DownloadPoisListAsync(){ }
Call the
DownloadPoisListAsync()
method from theOnCreate()
activity life cycle callback.Note that this chapter uses the Android...