From f18c200ca90c24c02c6d833e7ff785b8649d5ade Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 2 Dec 2019 17:37:08 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/constant/Action.kt | 2 +- app/src/main/java/io/legado/app/service/DownloadService.kt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/constant/Action.kt b/app/src/main/java/io/legado/app/constant/Action.kt index 297b38714..a13a8cca3 100644 --- a/app/src/main/java/io/legado/app/constant/Action.kt +++ b/app/src/main/java/io/legado/app/constant/Action.kt @@ -1,7 +1,7 @@ package io.legado.app.constant object Action { - + const val start = "start" const val play = "play" const val stop = "stop" const val resume = "resume" 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 2af217bc4..24ca25ce5 100644 --- a/app/src/main/java/io/legado/app/service/DownloadService.kt +++ b/app/src/main/java/io/legado/app/service/DownloadService.kt @@ -18,6 +18,7 @@ class DownloadService : BaseService() { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { intent?.action?.let { action -> when (action) { + Action.start -> download() Action.stop -> stopSelf() } } @@ -28,6 +29,10 @@ class DownloadService : BaseService() { super.onDestroy() } + private fun download() { + + } + /** * 更新通知 */