You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to download duplicate pictures and save them as picid(1),picid(2) etc.
I used to same url to download picture and i am saved the those picture as picture id.
So, they don't save into gallery.
It show D/ThinDownloadManager: cleanupDestination() deleting /storage/emulated/0/Pictures/ShareApp/Pic74402848.jpg
So, it's possible to download duplicate pictures.
Here is my code:
public void download(List pictureList) {
this.pictureList = pictureList;
Random random = new Random();
for (Picture picture : pictureList) {
RetryPolicy retryPolicy = new DefaultRetryPolicy();
Uri downloadUri = Uri.parse(picture.getPicUrl());
DownloadPictures.downloadIssue("Before Downloaded Picture Name" + picture.getPicUrl());
String fileName = "Pic" + picture.getPicId()/System.currentTimeMillis() + random.nextInt()/ + ".jpg";
Uri destinationUri = Uri.parse(shareAppFile + "/" + fileName);
DownloadRequest downloadRequest1 = new DownloadRequest(downloadUri)
.setDestinationURI(destinationUri).setPriority(DownloadRequest.Priority.LOW)
.setRetryPolicy(retryPolicy)
.setDownloadContext(picture.getPicId())
.setStatusListener(downloadStatusListenerV1);
downloadRequests.add(downloadManager.add(downloadRequest1));
}
}
The text was updated successfully, but these errors were encountered:
I want to download duplicate pictures and save them as picid(1),picid(2) etc.
I used to same url to download picture and i am saved the those picture as picture id.
So, they don't save into gallery.
It show D/ThinDownloadManager: cleanupDestination() deleting /storage/emulated/0/Pictures/ShareApp/Pic74402848.jpg
So, it's possible to download duplicate pictures.
Here is my code:
public void download(List pictureList) {
this.pictureList = pictureList;
Random random = new Random();
for (Picture picture : pictureList) {
RetryPolicy retryPolicy = new DefaultRetryPolicy();
Uri downloadUri = Uri.parse(picture.getPicUrl());
DownloadPictures.downloadIssue("Before Downloaded Picture Name" + picture.getPicUrl());
String fileName = "Pic" + picture.getPicId()/System.currentTimeMillis() + random.nextInt()/ + ".jpg";
Uri destinationUri = Uri.parse(shareAppFile + "/" + fileName);
DownloadRequest downloadRequest1 = new DownloadRequest(downloadUri)
.setDestinationURI(destinationUri).setPriority(DownloadRequest.Priority.LOW)
.setRetryPolicy(retryPolicy)
.setDownloadContext(picture.getPicId())
.setStatusListener(downloadStatusListenerV1);
downloadRequests.add(downloadManager.add(downloadRequest1));
}
}
The text was updated successfully, but these errors were encountered: