summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2023-08-19 10:55:32 +0200
committerByteHamster <ByteHamster@users.noreply.github.com>2023-08-19 11:21:52 +0200
commit056d262ab534f944e5ac514f8e73d21145ed1c24 (patch)
tree3cb981ea99115fa043d03be2313b503e2c0fb01a
parent18ab4ab8c6e3f957fec059b6214a45c90a3b2786 (diff)
downloadAntennaPod-056d262ab534f944e5ac514f8e73d21145ed1c24.zip
Fix ClassCastException when showing error message on video player
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/MediaPlayerErrorDialog.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/MediaPlayerErrorDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/MediaPlayerErrorDialog.java
index 306400b29..8425e0bfa 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/MediaPlayerErrorDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/MediaPlayerErrorDialog.java
@@ -21,8 +21,11 @@ public class MediaPlayerErrorDialog {
genericMessage.length(), errorMessage.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
errorDialog.setMessage(errorMessage);
- errorDialog.setPositiveButton(android.R.string.ok, (dialog, which) ->
- ((MainActivity) activity).getBottomSheet().setState(BottomSheetBehavior.STATE_COLLAPSED));
+ errorDialog.setPositiveButton(android.R.string.ok, (dialog, which) -> {
+ if (activity instanceof MainActivity) {
+ ((MainActivity) activity).getBottomSheet().setState(BottomSheetBehavior.STATE_COLLAPSED);
+ }
+ });
errorDialog.create().show();
}
}