From 8832e895397469bf54015a35e6f5588cb6b4451f Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 30 Jan 2024 17:37:34 +0100 Subject: [PATCH] Fix issue #1032 - Sharing videos only download them --- .../android/mastodon/activities/MediaActivity.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/mastodon/activities/MediaActivity.java b/app/src/main/java/app/fedilab/android/mastodon/activities/MediaActivity.java index d0d88278..c78991a5 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/activities/MediaActivity.java +++ b/app/src/main/java/app/fedilab/android/mastodon/activities/MediaActivity.java @@ -95,7 +95,8 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload shareIntent.setType(cR.getType(uri)); try { startActivity(shareIntent); - } catch (Exception ignored) { + } catch (Exception e) { + e.printStackTrace(); } } else { Toasty.error(context, context.getString(R.string.toast_error), Toasty.LENGTH_LONG).show(); @@ -164,7 +165,7 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload binding.mediaViewpager.setAdapter(mPagerAdapter); binding.mediaViewpager.setSaveEnabled(false); binding.mediaViewpager.setCurrentItem(mediaPosition - 1); - ContextCompat.registerReceiver(MediaActivity.this, onDownloadComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE), ContextCompat.RECEIVER_NOT_EXPORTED); + ContextCompat.registerReceiver(MediaActivity.this, onDownloadComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE), ContextCompat.RECEIVER_EXPORTED); String description = attachments.get(mediaPosition - 1).description; handler = new Handler(); if (attachments.get(mediaPosition - 1).status != null) { @@ -463,9 +464,7 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload } @Override - public void onDownloaded(String saveFilePath, String downloadUrl, Error error) { - - } + public void onDownloaded(String saveFilePath, String downloadUrl, Error error) {} @Override public void onUpdateProgress(int progress) {