2014-11-06 58 views
0

我想顯示一個計數器,但它不是在這裏工作的計數器是我的代碼:顯示在xamarin

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「只有創建視圖原來的線程層級可以觸及其觀點。「字符串

我該如何解決這個問題?

回答