[Android] VideoGrid: fix crash when display is called while data is updated

Thomas Guillem git at videolan.org
Thu Oct 8 15:48:20 CEST 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Oct  8 15:48:08 2015 +0200| [1745fc055cfa89a83707b7f90a9ea810b85b15d2] | committer: Thomas Guillem

VideoGrid: fix crash when display is called while data is updated

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=1745fc055cfa89a83707b7f90a9ea810b85b15d2
---

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

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 78ad5f5..752fa3d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -431,12 +431,12 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
                     else {
                         List<MediaGroup> groups = MediaGroup.group(itemList);
                         for (MediaGroup item : groups) {
-                            mVideoAdapter.setNotifyOnChange(false);
                             mVideoAdapter.add(item.getMedia());
                             if (mThumbnailer != null)
                                 mThumbnailer.addJob(item.getMedia());
                         }
                     }
+                    mVideoAdapter.setNotifyOnChange(true);
                     if (mReadyToDisplay)
                         display();
                 }
@@ -521,7 +521,6 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
                 public void run() {
                     mViewNomedia.setVisibility(mVideoAdapter.getCount() > 0 ? View.GONE : View.VISIBLE);
                     mReadyToDisplay = true;
-                    mVideoAdapter.setNotifyOnChange(true);
                     mVideoAdapter.sort();
                     mGVFirstVisiblePos = mGridView.getFirstVisiblePosition();
                     mGridView.setSelection(mGVFirstVisiblePos);



More information about the Android mailing list