[Android] Avoid unnecessary updates

Geoffrey Métais git at videolan.org
Thu Jan 12 13:04:57 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jan 12 11:44:11 2017 +0100| [89929f5b4a0633f3732947a10c340bdfb5f4ac6a] | committer: Geoffrey Métais

Avoid unnecessary updates

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.java b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.java
index 6321102..dea18bb 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.java
@@ -223,7 +223,8 @@ public class BaseBrowserAdapter extends RecyclerView.Adapter<BaseBrowserAdapter.
     }
 
     public void clear() {
-        dispatchUpdate(new ArrayList<MediaLibraryItem>(0));
+        if (!isEmpty())
+            dispatchUpdate(new ArrayList<MediaLibraryItem>(0));
     }
 
     public boolean isEmpty(){



More information about the Android mailing list