-3

How can I create a simple countdown in Android studio with a fixed start time? It should start the count down as soon as the application is opened. The preferable format is hh:mm:ss

thanks

Knokkelgeddon
  • 211
  • 1
  • 14

1 Answers1

0

Use Android Chronometer class to display countdown. Below is sample code:

<Chronometer
        android:id="@+id/chronometer1"
        android:textColor="#4169E1"
        android:textSize="20dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/button5"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="50dp"
        android:text="Chronometer" />
Geeky Singh
  • 1,003
  • 9
  • 20