From c7d858c1d7e06d4eee5283e2373c329a6a903c17 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 12 Nov 2019 15:42:00 +0800 Subject: [PATCH] up --- .../legado/app/ui/book/source/edit/BookSourceEditViewModel.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditViewModel.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditViewModel.kt index d15926638..82b50e536 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditViewModel.kt @@ -8,6 +8,7 @@ import io.legado.app.App import io.legado.app.base.BaseViewModel import io.legado.app.data.entities.BookSource import io.legado.app.help.storage.OldRule +import kotlinx.coroutines.Dispatchers class BookSourceEditViewModel(application: Application) : BaseViewModel(application) { @@ -49,7 +50,7 @@ class BookSourceEditViewModel(application: Application) : BaseViewModel(applicat } fun pasteSource(onSuccess: (source: BookSource) -> Unit) { - execute { + execute(context = Dispatchers.Main) { var source: BookSource? = null val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager? clipboard?.primaryClip?.let {