How to identify which file triggered Download_Complete intent

£可爱£侵袭症+ 提交于 2019-12-11 01:55:46

问题


I'm developing an application that will Download another apk file, and asks for it's installation.

Since my target is GingerBread I'm using the DownloadManager class.

Is there anyway to know which downloaded file triggered the DOWNLOAD_COMPLETE intent?


回答1:


It's stored in EXTRA_DOWNLOAD_ID:

public static final String EXTRA_DOWNLOAD_ID

Since: API Level 9

Intent extra included with ACTION_DOWNLOAD_COMPLETE intents, indicating the ID (as a long) of the download that just completed.

Constant Value: "extra_download_id"

http://developer.android.com/reference/android/app/DownloadManager.html#ACTION_DOWNLOAD_COMPLETE



来源:https://stackoverflow.com/questions/6713115/how-to-identify-which-file-triggered-download-complete-intent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!