DownloadManager.getUriForDownloadedFile(id)返回值为null的具体原因是什么?
DownloadManager是Android为开发者提供的一个后台应用组件,它通过Http层进行文件的下载任务. 1:使用 首先要在AndroidManifest.xml中申请访问DownloadManager的权限 添加一个下载任务: ContentValues values = new ContentValues();......
答案就在这里:Android中的DownloadManager
----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。
这是api level23中的解释, 除了下载成功 都会return null
public Uri getUriForDownloadedFile (long id)
Added in API level 11
Returns the Uri of the given downloaded file id, if the file is downloaded successfully. Otherwise, null is returned.
Parameters
id the id of the downloaded file.
Returns
the Uri of the given downloaded file id, if download was successful. null otherwise.