This commit is contained in:
Grishka 2024-07-13 22:32:17 +03:00
parent 0ba0d70124
commit c2e4781265
1 changed files with 4 additions and 1 deletions

View File

@ -597,7 +597,10 @@ public class PhotoViewer implements ZoomPanView.Listener{
req.allowScanningByMediaScanner();
req.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
req.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, uri.getLastPathSegment());
activity.registerReceiver(downloadCompletedReceiver, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.TIRAMISU)
activity.registerReceiver(downloadCompletedReceiver, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE), Context.RECEIVER_EXPORTED);
else
activity.registerReceiver(downloadCompletedReceiver, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
receiverRegistered=true;
lastDownloadID=activity.getSystemService(DownloadManager.class).enqueue(req);
new Snackbar.Builder(activity)