Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a Countup timer on Android?

Tags:

android

I'm currently doing my project and would like to add a timer for my android Sudoku game. I need to know the source code and how to put the source code into my Sudoku game. Please help i need it urgently :(

like image 675
user1209031 Avatar asked Feb 14 '12 12:02

user1209031


1 Answers

Layout XML:

<Chronometer
android:id="@+id/simpleChronometer"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

Code:

Chronometer simpleChronometer = (Chronometer) findViewById(R.id.simpleChronometer); // initiate a chronometer

simpleChronometer.start(); // start a chronometer

enter image description here

like image 133
Amos Avatar answered Oct 20 '22 14:10

Amos