Possible Duplicate:
Updating TextView every N seconds?
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.
for(int y=1;y<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));
}
}