Fix ClassCastException when showing error message on video player
This commit is contained in:
parent
18ab4ab8c6
commit
056d262ab5
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user