public async void DownloadPoisListAsync() { progressBar.Visibility = ViewStates.Visible; POIService service = new POIService(); if (!service.isConnected(this)) { Toast toast = Toast.MakeText(this, "Not conntected to internet.Please check your device network settings.", ToastLength.Long); toast.Show(); } else { poiListData = await service.GetPOIListAsync(); progressBar.Visibility = ViewStates.Gone; poiListAdapter = new POIListViewAdapter(this, poiListData); poiListView.Adapter = poiListAdapter; } }
private async void DeletePOIAsync() { POIService service = new POIService(); if (!service.isConnected(this)) { Toast toast = Toast.MakeText(this, "Not conntected to internet. Please check your device network settings.", ToastLength.Short); toast.Show(); return; } string response = await service.DeletePOIAsync(_poi.Id); if (!string.IsNullOrEmpty(response)) { Toast toast = Toast.MakeText(this, String.Format("{0} deleted.", _poi.Name), ToastLength.Short); toast.Show(); Finish(); } else { Toast toast = Toast.MakeText(this, "Something went Wrong!", ToastLength.Short); toast.Show(); } }