我想在將結果導入OStateUserId對象後運行此語句。如何在Xamarin中使用RunOnUIThread()Android
details.Text = OStateUserID.name + "\n" + OStateUserID.population);
bStateuserID.Click += async delegate
{
details.Text=" ";
Guid x = new Guid("33F8A8D5-0DF2-47A0-9C79-002351A95F88");
state OStateUserID =(state) await obj.GetStateByUserId(x.ToString());
details.Text = OStateUserID.name + "\n" + OStateUserID.population);
};
GetStateByUserId()
方法返回class State
的對象。
它異步運行。完成操作後,我想將名稱和人口分配給TextView詳細信息。
如何在這種情況下使用RunOnUIThread()
?