Reputation: 148
I am making a quiz application, in which I want to show the time used by the user while playing a session of game. It should be in format HH:MM:SS starting from 00:00:00 till he selects the answer. Timer should be updating every second while user is playing each second. Also, I want to pause the timer while next question is loading. I am not able to understand how to do this. Right now I am able to fetch current time by this code.
Calendar c = Calendar.getInstance();
SimpleDateFormat timeformat = new SimpleDateFormat("HH:mm:ss");
final String startTime = timeformat.format(c.getTime());
Play.timer_box.setText(""+startTime);
It just display whatever the current time is in the box in right format. But not able to understand how to achieve what i want to
Upvotes: 1
Views: 203
Reputation: 106
You cant just show the time using calendar,you have to write the logic
Upvotes: 1