private async void loadRepData() { JsonValue jsonResponse = await VoterHttpRequest.FetchRepresentativesAsync(address, this); if (jsonResponse != null) { Representatives = parser.ParseRepresentativeJson(jsonResponse); } else { Toast.MakeText(this, "no result retrieved", ToastLength.Long).Show(); } adapterReps.setDataSet(Representatives); showRepData(); }
private async void loadElectionData() { JsonValue jsonResponse = await VoterHttpRequest.FetchVoterInfoAsync(address, this); if (jsonResponse != null) { Elections = parser.ParseElectionJson(jsonResponse); adapterElecs = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, Elections); listViewElecs.Adapter = adapterElecs; listViewElecs.Visibility = ViewStates.Gone; } else { Elections = new List <Election> { new Election { name = "no election data found", date = "election info may not be available more than 2-4 weeks prior" } }; adapterElecs = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, Elections); listViewElecs.Adapter = adapterElecs; listViewElecs.Visibility = ViewStates.Gone; } }
private async void loadElectionInfo() { JsonValue jsonResponse = await VoterHttpRequest.FetchElectionInfoAsync(address, index, this); header.Text = parser.ParseElectionInfoJson(jsonResponse); }