[Android] MainActivity: don't stop scan when configuration changes

Thomas Guillem git at videolan.org
Tue Jun 21 19:21:49 CEST 2016


vlc-android | branch: 2.0.x | Thomas Guillem <thomas at gllm.fr> | Tue Jun 21 19:20:31 2016 +0200| [d264d3b61e7aa288bb611ccd9e864b625ea038b6] | committer: Thomas Guillem

MainActivity: don't stop scan when configuration changes

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index 3d2c157..5653216 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -409,10 +409,12 @@ public class MainActivity extends AudioPlayerContainerActivity implements Filter
     @Override
     protected void onPause() {
         super.onPause();
-        /* Check for an ongoing scan that needs to be resumed during onResume */
-        mScanNeeded = mMediaLibrary.isWorking();
-        /* Stop scanning for files */
-        mMediaLibrary.stop();
+        if (getChangingConfigurations() == 0) {
+            /* Check for an ongoing scan that needs to be resumed during onResume */
+            mScanNeeded = mMediaLibrary.isWorking();
+            /* Stop scanning for files */
+            mMediaLibrary.stop();
+        }
         /* Save the tab status in pref */
         SharedPreferences.Editor editor = mSettings.edit();
         editor.putInt("fragment_id", mCurrentFragmentId);



More information about the Android mailing list