From 5a2234258cd414c63acf6a844de44b2030031e0a Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 4 Jan 2022 09:56:08 +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 --- .../main/java/io/legado/app/service/WebService.kt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/service/WebService.kt b/app/src/main/java/io/legado/app/service/WebService.kt index 25fc5298a..676cba0bc 100644 --- a/app/src/main/java/io/legado/app/service/WebService.kt +++ b/app/src/main/java/io/legado/app/service/WebService.kt @@ -128,13 +128,16 @@ class WebService : BaseService() { private fun upTile(active: Boolean) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - startService { - action = if (active) { - IntentAction.start - } else { - IntentAction.stop + kotlin.runCatching { + startService { + action = if (active) { + IntentAction.start + } else { + IntentAction.stop + } } } + } } }