0
我正在從服務器下載圖像並將其保存在內部存儲器中。但我想隱藏圖庫中的這些圖像。我怎樣才能做到這一點?如何在Android中隱藏圖庫中的圖像?
我聽說命名文件夾.DirName
隱藏圖像,但它不起作用在我的情況。 (電話不是源於)
public void myDownload(String myURL) {
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(myURL));
//request.setTitle("File Download");
//request.setDescription("Downloading....");
//request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI);
request.allowScanningByMediaScanner();
//request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_HIDDEN);
String nameOfFile = URLUtil.guessFileName(myURL, null, MimeTypeMap.getFileExtensionFromUrl(myURL));
//request.setDestinationInExternalPublicDir(Environment.getExternalStorageDirectory().getPath() + "/KiiTTimeTableData/" + year + "/" + branch + "/" + section + "/", nameOfFile);
//request.setDestinationInExternalPublicDir("/MyDataFinal/", nameOfFile);
request.setDestinationInExternalPublicDir("/KiiTTimeTableData/Data/", nameOfFile);
DownloadManager manager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
manager.enqueue(request);
}