我尝试,在我下载之后检查这个文件是否存在,但它告诉我不存在
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.sailingdee.com/search/label/Blog"><img border="0" data-original-height="600" data-original-width="800" height="240" src="https://4.bp.blogspot.com/-tMoena8-dQ4/Wq2xGaFLNKI/AAAAAAAADuo/Yj5IHK-KqIktxj9vqznUagLsIuHdcCppgCLcBGAs/s320/SailingDee_Blog_BlogBottom.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.facebook.com/deethaifoodtruck"><img border="0" data-original-height="600" data-original-width="800" height="150" src="https://1.bp.blogspot.com/-f86zx3r_Y_Y/Wq2xGgksptI/AAAAAAAADuw/v6AOadiTIrYRlBHJTy_NsXlyNrslMaWKwCLcBGAs/s200/DeeThaiFoodTruck_BlogBottom.png" width="200" /></a>
<a href="http://www.facebook.com/sailingdee"><img border="0" data-original-height="600" data-original-width="800" height="150" src="https://1.bp.blogspot.com/-PM3T8_NpkL8/Wq2xGkm8unI/AAAAAAAADus/B5fITbfd4C4Qb2PG9pDz9NaBqw2H8X7fwCLcBGAs/s200/SailingDee_Facebook_BlogBottom.png" width="200" /></a></div>
<br />
答案 0 :(得分:1)
下载过程正在后台进行。因此,在enqueue()之后,您的文件不存在,因为它尚未下载。 您只需要注册BroadcastReceiver即可 ACTION_DOWNLOAD_COMPLETE意图过滤器。下载完成后,DownloadManager将广播。请参阅此处的文档:https://developer.android.com/reference/android/app/DownloadManager.html#ACTION_DOWNLOAD_COMPLETE