From 7fc98f6ec0feecc06d089f898760d46b5b717795 Mon Sep 17 00:00:00 2001 From: Mariotaku Lee Date: Sun, 14 May 2017 22:02:42 +0800 Subject: [PATCH] updated task executor --- build.gradle | 1 + twidere/build.gradle | 2 +- .../main/kotlin/org/mariotaku/twidere/app/TwidereApplication.kt | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index fe77d07e9..0f184c4c4 100644 --- a/build.gradle +++ b/build.gradle @@ -65,6 +65,7 @@ subprojects { AndroidImageCropper : '2.4.0', ExportablePreferences: '0.9.6', ACRA : '4.9.2', + AbstractTask : '0.9.5', ] } diff --git a/twidere/build.gradle b/twidere/build.gradle index 1af5f66e9..b4f420b45 100644 --- a/twidere/build.gradle +++ b/twidere/build.gradle @@ -190,7 +190,7 @@ dependencies { compile "com.github.mariotaku:SQLiteQB:${libVersions['SQLiteQB']}" compile "com.github.mariotaku.ObjectCursor:core:${libVersions['ObjectCursor']}" compile "com.github.mariotaku.ExportablePreferences:core:${libVersions['ExportablePreferences']}" - compile 'com.github.mariotaku:AbstractTask:0.9.4' + compile "com.github.mariotaku:AbstractTask:${libVersions['AbstractTask']}" compile "com.github.mariotaku.CommonsLibrary:parcel:${libVersions['MariotakuCommons']}" compile "com.github.mariotaku.CommonsLibrary:io:${libVersions['MariotakuCommons']}" compile "com.github.mariotaku.CommonsLibrary:text:${libVersions['MariotakuCommons']}" diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/app/TwidereApplication.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/app/TwidereApplication.kt index 108de6638..e11b55e20 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/app/TwidereApplication.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/app/TwidereApplication.kt @@ -34,6 +34,7 @@ import com.bumptech.glide.Glide import nl.komponents.kovenant.task import okhttp3.Dns import org.apache.commons.lang3.concurrent.ConcurrentUtils +import org.mariotaku.abstask.library.TaskStarter import org.mariotaku.commons.logansquare.LoganSquareMapperFinder import org.mariotaku.kpreferences.KPreferences import org.mariotaku.kpreferences.get @@ -318,6 +319,7 @@ class TwidereApplication : Application(), Constants, OnSharedPreferenceChangeLis Class.forName(AsyncTask::class.java.name) } catch (ignore: ClassNotFoundException) { } + TaskStarter.setDefaultExecutor(AsyncTask.SERIAL_EXECUTOR) val executor = Executors.newSingleThreadExecutor() LoganSquareMapperFinder.setDefaultExecutor(object : LoganSquareMapperFinder.FutureExecutor { override fun submit(callable: Callable): Future {