1
我使用DownloadManager爲我的應用下載文件。我看到幾個問題。 有時我會看到同時下載 - 同時下載2個文件(至少我看到2個通知)。其他問題是,對於一些文件,我看到的描述和一些沒有。下載管理器同時下載,缺少說明
DownloadManager如何工作?是否可以同時下載更多文件?或者什麼會導致這個問題?它可能是因爲應用程序有時被殺害,下載時重新啓動?
這是代碼,我使用:
Request request = new DownloadManager.Request(uri);
request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI);
request.setAllowedOverRoaming(false);
request.setTitle(episodeTitle);
request.setVisibleInDownloadsUi(false);
request.setDescription("Episode is downloading");
request.setDestinationUri(Uri.fromFile(file));
downloadManager.enqueue(request);
正如你可以在圖像波紋管看到,第二個通知中包含的說明,先不要。