[Android] Update empty view if needed

Geoffrey Métais git at videolan.org
Fri Jan 20 14:54:39 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jan 20 14:37:03 2017 +0100| [cb0fa2dc01729eb746e8e865381cfff27977d28b] | committer: Geoffrey Métais

Update empty view if needed

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

 .../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java        | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index e597125..a132a44 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -589,13 +589,15 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements DevicesDis
     @Override
     public void onMediaAdded(MediaWrapper[] mediaList) {
         mSongsAdapter.dispatchUpdate(mMediaLibrary.getAudio());
-        mHandler.sendEmptyMessage(UPDATE_EMPTY_VIEW);
+        if (mViewPager.getCurrentItem() == MODE_SONG)
+            mHandler.sendEmptyMessage(UPDATE_EMPTY_VIEW);
     }
 
     @Override
     public void onMediaUpdated(MediaWrapper[] mediaList) {
         mSongsAdapter.dispatchUpdate(mMediaLibrary.getAudio());
-        mHandler.sendEmptyMessage(UPDATE_EMPTY_VIEW);
+        if (mViewPager.getCurrentItem() == MODE_SONG)
+            mHandler.sendEmptyMessage(UPDATE_EMPTY_VIEW);
     }
 
     protected AudioBrowserAdapter getCurrentAdapter() {



More information about the Android mailing list