[Android] Fix MediaLib scan restoring

Geoffrey Métais git at videolan.org
Thu Feb 26 16:27:21 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb 26 16:25:01 2015 +0100| [88aa6bfc678fd0ee68280c003c6468720ad7908d] | committer: Geoffrey Métais

Fix MediaLib scan restoring

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

 vlc-android/src/org/videolan/vlc/gui/MainActivity.java |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index c2bcbff..9276f84 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -126,7 +126,7 @@ public class MainActivity extends ActionBarActivity implements OnItemClickListen
 
     private int mVersionNumber = -1;
     private boolean mFirstRun = false;
-    private boolean mScanNeeded = true;
+    private boolean mScanNeeded = false;
 
     private Handler mHandler = new MainActivityHandler(this);
     private int mFocusedPrior = 0;
@@ -176,8 +176,7 @@ public class MainActivity extends ActionBarActivity implements OnItemClickListen
         }
 
         /* Load media items from database and storage */
-        if (mScanNeeded)
-            MediaLibrary.getInstance().loadMediaItems();
+        MediaLibrary.getInstance().loadMediaItems();
 
         /* Theme must be applied before super.onCreate */
         applyTheme();
@@ -307,6 +306,11 @@ public class MainActivity extends ActionBarActivity implements OnItemClickListen
         /* FIXME: this is used to avoid having MainActivity twice in the backstack */
         if (getIntent().hasExtra(AudioService.START_FROM_NOTIFICATION))
             getIntent().removeExtra(AudioService.START_FROM_NOTIFICATION);
+
+
+        /* Load media items from database and storage */
+        if (mScanNeeded)
+            MediaLibrary.getInstance().loadMediaItems();
    }
 
     @Override



More information about the Android mailing list