private async void FillData() { MobileServiceRepository repo = new MobileServiceRepository(); List <string> list = await repo.GetPosts(); ArrayAdapter <string> adapter = new ArrayAdapter <string> (this, Resource.Layout.ListViewItem, list); listViewPosts.Adapter = adapter; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.AddPost); buttonSend = FindViewById <Button> (Resource.Id.buttonSend); editTextPost = FindViewById <EditText> (Resource.Id.editTextPost); progressBar1 = FindViewById <ProgressBar> (Resource.Id.progressBar1); progressBar1.Visibility = ViewStates.Invisible; MobileServiceRepository repo = new MobileServiceRepository(); buttonSend.Click += async delegate { await repo.AddPost(editTextPost.Text); progressBar1.Visibility = ViewStates.Visible; StartActivity(typeof(MainActivity)); }; // Create your application here }