diff --git a/app/src/main/java/com/simplemobiletools/gallery/fragments/PhotoFragment.java b/app/src/main/java/com/simplemobiletools/gallery/fragments/PhotoFragment.java index 06086e010..68a7357d4 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/fragments/PhotoFragment.java +++ b/app/src/main/java/com/simplemobiletools/gallery/fragments/PhotoFragment.java @@ -37,6 +37,9 @@ public class PhotoFragment extends ViewPagerFragment implements View.OnClickList @Override public void onClick(View v) { + if (listener == null) + listener = (FragmentClickListener) getActivity(); + listener.fragmentClicked(); } diff --git a/app/src/main/java/com/simplemobiletools/gallery/fragments/VideoFragment.java b/app/src/main/java/com/simplemobiletools/gallery/fragments/VideoFragment.java index ab7cde613..c66ab3f55 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/fragments/VideoFragment.java +++ b/app/src/main/java/com/simplemobiletools/gallery/fragments/VideoFragment.java @@ -156,6 +156,9 @@ public class VideoFragment extends ViewPagerFragment default: isFullscreen = !isFullscreen; checkFullscreen(); + + if (listener == null) + listener = (FragmentClickListener) getActivity(); listener.fragmentClicked(); break; }