2014-07-16 113 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"