0
在我的應用程序,我下載與Android |發送「臨時演員」,以廣播接收器
DownloadManager downloadManagerStore = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
Uri downloadUri = Uri.parse(queryURL);
DownloadManager.Request request = new DownloadManager.Request(downloadUri);
request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI | DownloadManager.Request.NETWORK_MOBILE)
.setAllowedOverRoaming(false) .setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE)
.setDestinationInExternalPublicDir(dir);
downloadManagerStore.enqueue(request);
一些文件,我管理與BroadcastReceiver
的文件,這是代碼:
@Override
public void onReceive(Context context, Intent intent) {
this.context = context;
//do something
}
但我做兩個不同的下載,當他們完成BroadcastReceiver
運行,但我怎麼知道哪個下載完成?
http://developer.android.com/reference/android/app/DownloadManager.html#EXTRA_DOWNLOAD_ID – CommonsWare