如何确定哪些文件触发Download_Complete意图 [英] How to identify which file triggered Download_Complete intent
问题描述
我正在开发,将下载其他APK文件的应用程序,并要求它的安装。
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.
反正是有知道下载的文件引发了DOWNLOAD_COMPLETE意图是什么?
Is there anyway to know which downloaded file triggered the DOWNLOAD_COMPLETE intent?
推荐答案
它存储在EXTRA_DOWNLOAD_ID:
It's stored in EXTRA_DOWNLOAD_ID:
public static final String EXTRA_DOWNLOAD_ID
自:API等级9
Since: API Level 9
包含ACTION_DOWNLOAD_COMPLETE意图意图额外的,这表明刚完成下载的ID(long类型)。
Intent extra included with ACTION_DOWNLOAD_COMPLETE intents, indicating the ID (as a long) of the download that just completed.
恒值:extra_download_id
Constant Value: "extra_download_id"
<一个href=\"http://developer.android.com/reference/android/app/DownloadManager.html#ACTION_DOWNLOAD_COMPLETE\" rel=\"nofollow\">http://developer.android.com/reference/android/app/DownloadManager.html#ACTION_DOWNLOAD_COMPLETE
这篇关于如何确定哪些文件触发Download_Complete意图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!