开发者

Question about Threads and Timer object at an interval time

开发者 https://www.devze.com 2023-02-14 13:28 出处:网络
I just need to refresh a ListView with a Feed, which you recommend me for this? A thread? A timer object? I was thinking use a Timer Object with an interval time.

I just need to refresh a ListView with a Feed, which you recommend me for this? A thread? A timer object? I was thinking use a Timer Object with an interval time.

But i am thinking at the moment when a user leave the activity and maybe the timer could not be stopped.

开发者_开发问答

what do you think?


I would suggest using a ScheduledExecutorService:ScheduledExecutorService

The link I have provided has a code example.

0

精彩评论

暂无评论...
验证码 换一张
取 消