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 15d2878a6..97f6fd081 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -5,6 +5,7 @@ import android.app.Activity import android.content.Intent import android.content.pm.PackageManager import android.net.Uri +import android.os.AsyncTask import android.os.Bundle import android.provider.MediaStore import android.support.v4.app.ActivityCompat @@ -175,7 +176,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { mCurrAsyncTask = GetDirectoriesAsynctask(applicationContext, mIsPickVideoIntent || mIsGetVideoContentIntent, mIsPickImageIntent || mIsGetImageContentIntent) { gotDirectories(it) } - mCurrAsyncTask!!.execute() + mCurrAsyncTask!!.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR) } private fun showSortingDialog() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index e6eb87e39..d9bfd91e0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -5,6 +5,7 @@ import android.app.WallpaperManager import android.content.Intent import android.graphics.Bitmap import android.net.Uri +import android.os.AsyncTask import android.os.Bundle import android.support.v7.widget.GridLayoutManager import android.util.Log @@ -230,7 +231,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { mCurrAsyncTask = GetMediaAsynctask(applicationContext, mPath, mIsGetVideoIntent, mIsGetImageIntent, mShowAll) { gotMedia(it) } - mCurrAsyncTask!!.execute() + mCurrAsyncTask!!.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR) } private fun isDirEmpty(): Boolean { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 7169d878b..77742d17e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -11,6 +11,7 @@ import android.graphics.Matrix import android.hardware.SensorManager import android.media.ExifInterface import android.net.Uri +import android.os.AsyncTask import android.os.Build import android.os.Bundle import android.provider.MediaStore @@ -414,7 +415,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View invalidateOptionsMenu() checkOrientation() } - mCurrAsyncTask!!.execute() + mCurrAsyncTask!!.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR) } private fun getProperPosition(): Int {