From 56fc9d2b959092a256324f04829643d57cbdaa03 Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 14 Sep 2020 21:52:05 +0800 Subject: [PATCH] update log --- app/src/main/java/io/legado/app/service/DownloadService.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/service/DownloadService.kt b/app/src/main/java/io/legado/app/service/DownloadService.kt index c069ab6c4..53868a977 100644 --- a/app/src/main/java/io/legado/app/service/DownloadService.kt +++ b/app/src/main/java/io/legado/app/service/DownloadService.kt @@ -20,7 +20,6 @@ import io.legado.app.help.IntentHelp import io.legado.app.utils.RealPathUtil import io.legado.app.utils.msg import org.jetbrains.anko.downloadManager -import org.jetbrains.anko.notificationManager import org.jetbrains.anko.toast import java.io.File @@ -69,10 +68,8 @@ class DownloadService : BaseService() { } IntentAction.stop -> { val downloadId = intent.getLongExtra("downloadId", 0) - if (downloadId > 0) { - downloadManager.remove(downloadId) - notificationManager.cancel(downloadId.toInt()) - } else { + downloads.remove(downloadId) + if (downloads.isEmpty()) { stopSelf() } }