DownloadManager sends STATUS_SUCCESSFUL for failed download

前端 未结 1 619
[愿得一人]
[愿得一人] 2021-01-18 05:28

Okay, I\'m downloading files (images). I want to send a message with local URI for the image when the download is completed. But 20% of time I\'m getting this:



        
1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-18 05:29

    DownloadManager is buggy and doesn't work correctly. This bug was filed with Google a while back:

    https://code.google.com/p/android/issues/detail?id=18462

    For single file download, you could workaround this by specifying a unique directory to download to specifically for this purpose, and just take whatever you get in that directory upon DownloadManager.STATUS_SUCCESSFUL.
    For multi-file downloads, I can't think of a workaround at the moment, unless you have the ability to rename files at the source.

    0 讨论(0)
提交回复
热议问题