From 0ff380e183b1e756729b369a0a013f534c83c4ca Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 3 Feb 2020 20:32:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/changecover/ChangeCoverViewModel.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/changecover/ChangeCoverViewModel.kt b/app/src/main/java/io/legado/app/ui/changecover/ChangeCoverViewModel.kt index 5469717bd..27899a44c 100644 --- a/app/src/main/java/io/legado/app/ui/changecover/ChangeCoverViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/changecover/ChangeCoverViewModel.kt @@ -8,7 +8,6 @@ import io.legado.app.help.AppConfig import io.legado.app.help.coroutine.Coroutine import io.legado.app.model.WebBook import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.asCoroutineDispatcher import kotlinx.coroutines.withContext import java.util.concurrent.Executors @@ -49,7 +48,7 @@ class ChangeCoverViewModel(application: Application) : BaseViewModel(application App.db.searchBookDao().insert(searchBook) callBack?.adapter?.let { adapter -> if (!adapter.getItems().contains(searchBook)) { - withContext(Main) { + withContext(Dispatchers.Main) { adapter.addItem(searchBook) } }