title: how to update the textview variable for every 5 seconds
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4776514/updating-textview-every-n-seconds">Updating TextView every N seconds?</a>  </p>
  </blockquote>
  
  
  
  <p>Here, I want to update the Hr value in the textview once it is calculated for every iteration, but with a delay of 2 seconds each time. I dont know how to do it. What i get now in the textview is the last value of the iteration. I want all the values to be displayed at a constant delay. anyone help pls.</p>
  
  <pre><code>    for(int y=1;y&lt;p.length;y++)
      {
         if(p[y]!=0)
          {
          r=p[y]-p[y-1];
            double x= r/500;
            Hr=(int) (60/x);
            Thread.sleep(2000);
           settext(string.valueof(Hr));
        }
      }
  </code></pre>