Here is the link where i have discussed about a countdown timer of format(mm:ss) in Java:
Java console code for StopWatch/Timer?
Now i want to display (and u
try this code.....
tv = new TextView(this);
this.setContentView(tv);
//10000 is the starting number (in milliseconds)
//1000 is the number to count down each time (in milliseconds)
MyCount counter = new MyCount(10000,1000);
counter.start();
}
//countdowntimer is an abstract class, so extend it and fill in methods
public class MyCount extends CountDownTimer
{
public MyCount(long millisInFuture, long countDownInterval)
{
super(millisInFuture, countDownInterval);
}
public void onFinish()
{
tv.setText("Time Up!");
}
public void onTick(long millisUntilFinished)
{
tv.setText("Time Left : " + millisUntilFinished/1000);
}