开发者

Starting android service with two ways

开发者 https://www.devze.com 2023-03-12 22:24 出处:网络
I have a batch of data to load from web. But I need to initiate loading in开发者_C百科 two ways:

I have a batch of data to load from web. But I need to initiate loading in开发者_C百科 two ways: 1) Every N minuts 2) Immediately loading by click refresh button

Which is best way to implement this issue? Should I create two services: firs for looping datat loading and second for single loading, or i can combine this functionality into one service or something else?

Thank you!


You can write a single function that loads the data from the web and then write a method that calls that function after a specified time ,and also call the same function on refresh button click event.

0

精彩评论

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

关注公众号