From 2c2f0ea5f672e32156104d1a7f737b37ce2e7d4c Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 23 Nov 2017 09:07:10 +0100 Subject: [PATCH] fix #470, avoid running 2 directory fetching async tasks at once --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 2059b0cae..232e2835a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -247,7 +247,9 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } mLoadedInitialPhotos = true + mCurrAsyncTask?.stopFetching() mCurrAsyncTask = GetDirectoriesAsynctask(applicationContext, mIsPickVideoIntent || mIsGetVideoContentIntent, mIsPickImageIntent || mIsGetImageContentIntent) { + mCurrAsyncTask = null gotDirectories(addTempFolderIfNeeded(it), false) } mCurrAsyncTask!!.execute()