2014-07-16 112 views
0

我使用通用的图像加载器加载图像 和我使用的下载按钮下载图像.nomedia文件夹无法隐藏图片?

这里是下载代码

DownloadManager mgr = (DownloadManager) this 
         .getSystemService(Context.DOWNLOAD_SERVICE); 

       Uri downloadUri = Uri.parse(imageUrls[NUMBER]); 
       DownloadManager.Request request = new DownloadManager.Request(
         downloadUri); 

       request.setAllowedNetworkTypes(
         DownloadManager.Request.NETWORK_WIFI 
           | DownloadManager.Request.NETWORK_MOBILE) 
         .setAllowedOverRoaming(false) 
         .setTitle("Demo") 
         .setDescription("Something useful. No, really.") 
         .setDestinationInExternalFilesDir(this,getFilesDir()+"/fname/." + publicationID, 
           "image" + NUMBER + ".jpg"); 
mgr.enqueue(request); 

了这里的工作的罚款

问题是我不想在图库中显示下载的图像

我试过“.nomedia”文件和文件夹..没有运气

感谢您的时间,等待响应

回答

0

我跑了下载后的媒体扫描..其现在的工作

sendBroadcast (
      new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory()))); 

thanks @axius

0

尝试使用:的

".image" + NUMBER + ".jpg" 

代替

"image" + NUMBER + ".jpg"