【发布时间】:2014-05-13 17:52:46
【问题描述】:
您能帮我解决以下问题吗? 我有一些代码:
button.Click += (sender, e) => Search_Click();
....
void Search_Click()
{
// here i'am trying to clear some ListView
var list = FindViewById<ListView> (Resource.Id.terminalsList);
list.Adapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, new List<string>());
// here i am trying to show ProgressDialog
ProgressDialog progress = new ProgressDialog(this);
progress.SetMessage("Wait while loading...");
progress.Show();
// but here i haven't ProgressDialog and clear ListView yet
......
// another code
}
但是这段代码不能正常工作。此代码是在 Search_Click 方法完成后执行的,但我希望立即执行此代码。我该怎么做?
提前致谢
【问题讨论】:
标签: android android-activity xamarin.android xamarin progressdialog