2016-03-30 12 views
0

)画像をダウンロードするこのコードはありますが、何らかの理由で画像がダウンロードされずにダウンロードされています。DownloadManagerからダウンロードされた画像(

 String url = file.public_url; 

     getContext(); 
     DownloadManager manager = (DownloadManager) getContext().getSystemService(Context.DOWNLOAD_SERVICE); 
     Uri uri = Uri.parse(url); 

     DownloadManager.Request request = new DownloadManager.Request(uri); 

     request.setTitle(file.filename); 
     request.setDescription(file.filename + " description."); 
     request.allowScanningByMediaScanner(); 
     request.setAllowedOverRoaming(true); 
     request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI | DownloadManager.Request.NETWORK_MOBILE); 
     request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); 
     request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, file.filename + file.file_extension); 

     manager.enqueue(request); 
+0

を使用していない、この非同期バージョンで画像を正常にダウンロードしていますか? –

+0

@MateusGondimこれは問題を解決しません。 –

答えて

関連する問題