private async void internetConnection() { if (UITools.isConnected()) { UITools.checkInternetConnection(this); progressDialog = UITools.CreateAndShowLoadingDialog(this); await RESTService.DownloadFromApi <List <Category> >(APIUrlsMap.Categories).ContinueWith(t => { RunOnUiThread(() => { UITools.EndLoadingDialog(progressDialog); }); }); categoryListView.SetAdapter(new CategoryListViewAdapter(this, SessionService.Data[APIUrlsMap.Categories] as List <Category>)); categoryListView.ChildClick += OnSubcategoryClickHandler; } else { UITools.checkInternetConnection(this); Toast.MakeText(ApplicationContext, "Aplikacja wymaga uzycia internetu !", ToastLength.Short).Show(); } }