[Android] Prevent IllegalStateException

Geoffrey Métais git at videolan.org
Mon Aug 21 17:57:55 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Aug 21 16:49:41 2017 +0200| [875c5d33006cbdea715b2ab97f04bce30ed30f7e] | committer: Geoffrey Métais

Prevent IllegalStateException

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

 vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java
index a7e4c4b36..48e7f6b56 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java
@@ -195,6 +195,8 @@ public class MediaItemDetailsFragment extends DetailsFragment implements Playbac
                 VLCApplication.runOnMainThread(new Runnable() {
                     @Override
                     public void run() {
+                        if (isDetached())
+                            return;
                         if (media.getType() == MediaWrapper.TYPE_DIR && FileUtils.canSave(media)) {
                             mDb = MediaDatabase.getInstance();
                             detailsOverview.setImageDrawable(getResources().getDrawable(TextUtils.equals(media.getUri().getScheme(),"file")



More information about the Android mailing list