diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/videos/RelatedItemsFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/videos/RelatedItemsFragment.java index a7ca549fb0f..6dc9a0cb484 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/videos/RelatedItemsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/videos/RelatedItemsFragment.java @@ -181,6 +181,9 @@ protected ItemViewMode getItemViewMode() { protected void showInfoItemDialog(final StreamInfoItem item) { try { final Fragment parentFragment = getParentFragment(); + + // Try and attach the InfoItemDialog to the parent fragment of the RelatedItemsFragment + // so that its context is not lost when the RelatedItemsFragment is reinitialized. if (parentFragment != null) { new InfoItemDialog.Builder( parentFragment.getActivity(),