From bb73171c126754a31341396344732636678bdef7 Mon Sep 17 00:00:00 2001 From: Administrator <1760316362@qq.com> Date: Mon, 8 Jul 2019 14:08:30 +0800 Subject: [PATCH] Coroutine --- .../io/legado/app/ui/search/SearchViewModel.kt | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/search/SearchViewModel.kt b/app/src/main/java/io/legado/app/ui/search/SearchViewModel.kt index acdc64c86..86df445b5 100644 --- a/app/src/main/java/io/legado/app/ui/search/SearchViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/search/SearchViewModel.kt @@ -16,23 +16,6 @@ class SearchViewModel(application: Application) : BaseViewModel(application) { val searchBooks: LiveData> = MutableLiveData() fun search(start: (() -> Unit)? = null, finally: (() -> Unit)? = null) { -// launchOnUI( -// { -// start?.let { it() } -// val searchResponse = withContext(IO) { -// val response: Deferred = HttpHelper.getApiService( -// "http://www.baidu.com" -// ).get("http://www.baidu.com") -// -// } -// -//// val result = searchResponse.await() -//// -//// println(result) -// }, -// { error { "${it.message}" } }, -// { finally?.let { it() } }) - execute { val response: String = HttpHelper.getApiService( "http://www.baidu.com"