How to handle multiple countdown timers in RecyclerView?

后端 未结 5 2204
长情又很酷
长情又很酷 2021-02-10 06:45

I have a Recyclerview , and I need to display a countdown on every row.

Here is a similar question coutndown timers in listview It has a good solution ,

5条回答
  •  被撕碎了的回忆
    2021-02-10 07:15

    Add a CountDownTimer member in the ViewHolder. In getView() set and start the counter, and don't forget to cancel any existing one in the same instance of ViewHolder. In onTick() you need to update the value on the display, not start the counter.

提交回复
热议问题