我正在尝试显示一个计数器,但它在这里不起作用是我的代码:
protected void t_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
EditText v2 = (EditText)FindViewById(Resource.Id.editText5);
counter1--;
if (counter1 <= 0) {
counter1 = 59;
timer1--;
}
if (timer1 <= 0) {
t.Stop ();
}
try{
v2.Text = timer1+ ":"+ counter1;
}
catch( Exception e8)
{
AlertDialog.Builder builder = new AlertDialog.Builder (this);
builder.SetMessage (e8.Message);
builder.Create().Show();
}
}
`我收到此错误:e8.Message&#34;只有创建视图层次结构的原始线程才能触及其视图。&#34;串
我该如何解决这个问题?