Android countdown

前端 未结 3 2599
抹茶落季
抹茶落季 2021-02-20 18:11

I want to write a countdown in android which starts counting from 3 to 0. Like at first 3 in appearing and then disappearing and 2 is appearing and so on. I searched a lot but I

3条回答
  •  自闭症患者
    2021-02-20 19:12

    I am not going to write you the code for this but this should not be difficult.Just use a thread to display the value 3(using say TextView) first then sleep for say (100ms assuming you want it to change after 1 sec) then decrease it and repeat.

    An example would be

    for i=0 to 3
    print the number 
    thread.sleep(100)
    

提交回复
热议问题