updated task executor

This commit is contained in:
Mariotaku Lee 2017-05-14 22:02:42 +08:00
parent dd457f0db6
commit 7fc98f6ec0
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
3 changed files with 4 additions and 1 deletions

View File

@ -65,6 +65,7 @@ subprojects {
AndroidImageCropper : '2.4.0',
ExportablePreferences: '0.9.6',
ACRA : '4.9.2',
AbstractTask : '0.9.5',
]
}

View File

@ -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']}"

View File

@ -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 <T> submit(callable: Callable<T>): Future<T> {