I am downloading images from server and saving it in internal storage. But i want to hide those images from the Gallery. How can i do that?
I have heard that naming folder with .DirName
hides the images but it doesn't work in my case. (Phone NOT Rooted)
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);
}