I want to have a automatic timer which start when we enter in this activity. And on next round its start again from some time and goes on decreasing. i know for this i have to create textview in question xml related to this call. but i dont know where and how to write code in this class. timer time 30 sec.
You can achiev this using CountDownTimer
new CountDownTimer(30000, 1000) {
public void onTick(long millisUntilFinished) {
mTextField.setText("seconds remaining: " + millisUntilFinished / 1000);
}
public void onFinish() {
mTextField.setText("done!");
}
}.start();
For more info refer here