This commit is contained in:
Grishka 2022-04-24 15:41:15 +03:00
parent 61d537779b
commit 0dd5e5af8d
1 changed files with 5 additions and 1 deletions

View File

@ -514,7 +514,11 @@ public class PhotoViewer implements ZoomPanView.Listener{
}
private void saveViaDownloadManager(Attachment att){
DownloadManager.Request req=new DownloadManager.Request(Uri.parse(att.url));
Uri uri=Uri.parse(att.url);
DownloadManager.Request req=new DownloadManager.Request(uri);
req.allowScanningByMediaScanner();
req.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
req.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, uri.getLastPathSegment());
activity.getSystemService(DownloadManager.class).enqueue(req);
Toast.makeText(activity, R.string.downloading, Toast.LENGTH_SHORT).show();
}