title: How to change a TextView every second in Xamarin Android
body: <p>I am trying to refresh a TextView every second (after a Button Click) in Xamarin Android using the following code (simplified):</p>
  
  <pre><code>void OnClick_Start(object sender, EventArgs ea)
      {
          RunOnUiThread(() =&gt;
          {
              txtTest.Text = "Starting";
              Thread.Sleep(1000);
              txtTest.Text = "1000";
              Thread.Sleep(1000);
              txtTest.Text = "2000";
              Thread.Sleep(1000);
              txtTest.Text = "3000";
              Thread.Sleep(1000);
              txtTest.Text = "4000";
          });
      }
  </code></pre>
  
  <p>But I get only displayed the last value "4000" after 4 secs and not the intermediate values.</p>
  
  <p>I have also used the following code with the same results</p>
  
  <pre><code>void OnClick_Start(object sender, EventArgs ea)
      {
          new Thread(new ThreadStart(() =&gt;
          {
              RunOnUiThread(() =&gt;
              {
                  txtTest.Text = "Starting";
                  Thread.Sleep(1000);
                  txtTest.Text = "1000";
                  Thread.Sleep(1000);
                  txtTest.Text = "2000";
                  Thread.Sleep(1000);
                  txtTest.Text = "3000";
                  Thread.Sleep(1000);
                  txtTest.Text = "4000";
              });
          })).Start();
      }
  </code></pre>
  
  <p>How can I get the result that I want?</p>