Commit 30007fba authored by Geoffrey Métais's avatar Geoffrey Métais

Restore scan after interrupted refresh

parent addf38f8
......@@ -105,6 +105,7 @@ public class MainActivity extends AudioPlayerContainerActivity implements OnItem
private int mVersionNumber = -1;
private boolean mFirstRun = false;
private boolean mScanNeeded = false;
private Handler mHandler = new MainActivityHandler(this);
private int mFocusedPrior = 0;
......@@ -220,9 +221,12 @@ public class MainActivity extends AudioPlayerContainerActivity implements OnItem
protected void onResume() {
super.onResume();
/* Load media items from database and storage */
if (mScanNeeded)
mMediaLibrary.loadMediaItems();
if (mSlidingPane.getState() == mSlidingPane.STATE_CLOSED)
mActionBar.hide();
}
}
@Override
protected void onResumeFragments() {
......@@ -266,6 +270,8 @@ public class MainActivity extends AudioPlayerContainerActivity implements OnItem
@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();
/* Save the tab status in pref */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment