Android: How do I display an updating clock in a TextView

前端 未结 6 973
时光说笑
时光说笑 2020-12-08 02:49

have a clock I want to display in a TextView.

I would have thought there was a few nice functions to do this, but I couldn\'t find anything. I ended up implementing

6条回答
  •  暖寄归人
    2020-12-08 03:44

    Remember: premature optimization is the root of all evil. So only optimize when you are sure (=have measured it) that your implementation is slow/inefficient.

    That said, a more efficient method would probably be to record start time via System.currentTimeMillis() and then periodically check it and calculate difference in minutes.

提交回复
热议问题