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() { + + } + /** * 更新通知 */