[Android] NetworkFragment does not refresh in fast browsing

Geoffrey Métais git at videolan.org
Mon Dec 5 16:43:35 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Dec  5 16:42:42 2016 +0100| [695f6459a00e8c16c9bbde99f02ca7a935004aa7] | committer: Geoffrey Métais

NetworkFragment does not refresh in fast browsing

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java
index 9d09da4..e3df9ba 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java
@@ -64,6 +64,7 @@ public class NetworkBrowserFragment extends BaseBrowserFragment {
         if (mMrl == null)
             mMrl = ROOT;
         mRoot = ROOT.equals(mMrl);
+        skipRefresh = !mAdapter.isEmpty();
     }
 
     @Override
@@ -262,6 +263,7 @@ public class NetworkBrowserFragment extends BaseBrowserFragment {
         dialog.show(fm, "fragment_add_server");
     }
 
+    private boolean skipRefresh = false;
     private final BroadcastReceiver networkReceiver = new BroadcastReceiver() {
         boolean connected = true;
         @Override
@@ -278,7 +280,10 @@ public class NetworkBrowserFragment extends BaseBrowserFragment {
                             return; //block consecutive calls when disconnected
                     } else
                         connected = true;
-                    refresh();
+                    if (skipRefresh)
+                        skipRefresh = false;
+                    else
+                        refresh();
                 }
             }
         }



More information about the Android mailing list