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 {