I want to build an android application, this application allow the users to answer some questions.
For every question, User have to answer it in 360 seconds, so I want to make a digital clock starts from 360secons and then down to 0 seconds
I read that I can’t set time on digital clock , is it so?
or I have to use Chronometer?
this is my digital clock
DigitalClock timer;
public void init(){
timer=(DigitalClock)findViewById(R.id.dcTimer);
}
any help appreciated.
Use CountDownTimer instead.
That link also shows you how to update a
TextViewevery 1 second.Just change
new CountDownTimer(30000, 1000)so the first parameter is360000instead of30000and that will give you a good start to your code.EDIT : You need to import
android.os.CountDownTimerand the code example I referred to is below. Good luck.