Download files in queue in Android

前端 未结 3 1206
再見小時候
再見小時候 2021-01-01 08:05

How do I download multiple files in a queue one by one! I\'m using this as a sample code, since. I would be passing the URLs to download in Strings from my local DB dynamic

3条回答
  •  隐瞒了意图╮
    2021-01-01 08:33

    A good way of queuing up requests to be handled asynchronously, one at a time, is with an IntentService. If you have an IntentService which reads URLs from the supplied Intent, then all you have to do is create an Intent for each file you want to download, and send each Intent to the service,

    Here is a good tutorial.

    EDIT: I see you've already referred to a similar question, where the answer recommends IntentService. So, maybe you should use an IntentService. :)

提交回复
热议问题