[Android] Run adapter update from main thread

Geoffrey Métais git at videolan.org
Tue Nov 7 13:32:42 CET 2017


vlc-android | branch: 2.5.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Nov  7 12:59:15 2017 +0100| [5dc0c03ccfcf40bd05543243fd3d88fe84fe09d9] | committer: Geoffrey Métais

Run adapter update from main thread

(cherry picked from commit b307d2a0343cc8027e30b0e9c59e468aef103662)

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

 .../src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
index e00d99afe..2a1695b12 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -351,7 +351,12 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd
             return;
         if (refreshing && !mRoot) {
             refreshing = false;
-            mAdapter.update(refreshList);
+            VLCApplication.runOnMainThread(new Runnable() {
+                @Override
+                public void run() {
+                    mAdapter.update(refreshList);
+                }
+            });
         } else
             refreshList = null;
 



More information about the Android mailing list