2012-09-26 51 views
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); 

正如你可以在圖像波紋管看到,第二個通知中包含的說明,先不要。

enter image description here

回答

0

看起來像你這兩個文件下載到同一個文件夾。 嘗試將每個文件下載到單獨的文件夾中。 這應該有所幫助。