[Android] Videos: class cast check

Geoffrey Métais git at videolan.org
Thu Jan 17 15:16:05 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jan 17 14:45:30 2019 +0100| [afdf60139e5f84bab81ea10a0244073fe7f4bfb3] | committer: Geoffrey Métais

Videos: class cast check

> https://code.videolan.org/videolan/vlc-android/commit/afdf60139e5f84bab81ea10a0244073fe7f4bfb3
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index b8c21e1e7..9157a827a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -360,7 +360,8 @@ public class VideoGridFragment extends MediaBrowserFragment<VideosModel> impleme
         final Activity activity = getActivity();
         if (media instanceof MediaGroup) {
             final String title = media.getTitle().substring(media.getTitle().toLowerCase().startsWith("the") ? 4 : 0);
-            ((MainActivity)activity).getNavigator().showSecondaryFragment(SecondaryActivity.VIDEO_GROUP_LIST, title);
+            if (activity instanceof MainActivity)
+                ((MainActivity)activity).getNavigator().showSecondaryFragment(SecondaryActivity.VIDEO_GROUP_LIST, title);
         } else {
             media.removeFlags(MediaWrapper.MEDIA_FORCE_AUDIO);
             final SharedPreferences settings = Settings.INSTANCE.getInstance(v.getContext());



More information about the Android mailing list