[Android] Fix IllegalStateException in VideoGridFragment

Nicolas Pomepuy git at videolan.org
Wed Aug 5 14:29:59 CEST 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Aug  5 09:58:00 2020 +0200| [4e732e63c040beea31c3ef7ecf7f44517a493ea2] | committer: Nicolas Pomepuy

Fix IllegalStateException in VideoGridFragment

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

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

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
index b4ad9f72e..f599637fa 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
@@ -118,7 +118,7 @@ class VideoGridFragment : MediaBrowserFragment<VideosViewModel>(), SwipeRefreshL
             (it as? PagedList<MediaLibraryItem>)?.let { videoListAdapter.submitList(it) }
             updateEmptyView()
             restoreMultiSelectHelper()
-            if (viewModel.group != null && it.size < 2) requireActivity().finish()
+            if (activity?.isFinishing == false && viewModel.group != null && it.size < 2) requireActivity().finish()
         })
 
         viewModel.provider.loading.observe(this, Observer { loading ->



More information about the Android mailing list