summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2024-08-30 18:07:59 +0200
committerGitHub <noreply@github.com>2024-08-30 18:07:59 +0200
commit279d37e8bb3b32402121f85830a50db364c3309d (patch)
tree20df91ff927bde22293cda0d35475b460fd3133b
parentaa28a65222302a037da948da1adb974d83b85643 (diff)
downloadAntennaPod-279d37e8bb3b32402121f85830a50db364c3309d.zip
Fix snackbar crash when on old Android versions (#7361)
-rw-r--r--app/src/main/java/de/danoeh/antennapod/ui/screen/feed/FeedInfoFragment.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/ui/screen/feed/FeedInfoFragment.java b/app/src/main/java/de/danoeh/antennapod/ui/screen/feed/FeedInfoFragment.java
index 6169e3888..87636f533 100644
--- a/app/src/main/java/de/danoeh/antennapod/ui/screen/feed/FeedInfoFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/ui/screen/feed/FeedInfoFragment.java
@@ -84,9 +84,11 @@ public class FeedInfoFragment extends Fragment implements MaterialToolbar.OnMenu
android.content.ClipboardManager cm = (android.content.ClipboardManager) getContext()
.getSystemService(Context.CLIPBOARD_SERVICE);
cm.setPrimaryClip(clipData);
- if (Build.VERSION.SDK_INT <= 32) {
+ if (Build.VERSION.SDK_INT <= 32 && getActivity() instanceof MainActivity) {
((MainActivity) getActivity()).showSnackbarAbovePlayer(R.string.copied_to_clipboard,
Snackbar.LENGTH_SHORT);
+ } else if (Build.VERSION.SDK_INT <= 32) {
+ Snackbar.make(getView(), R.string.copied_to_clipboard, Snackbar.LENGTH_SHORT).show();
}
}
}