pull/51/head
kunfei 5 years ago
parent f3fa9d3efe
commit f18c200ca9
  1. 2
      app/src/main/java/io/legado/app/constant/Action.kt
  2. 5
      app/src/main/java/io/legado/app/service/DownloadService.kt

@ -1,7 +1,7 @@
package io.legado.app.constant package io.legado.app.constant
object Action { object Action {
const val start = "start"
const val play = "play" const val play = "play"
const val stop = "stop" const val stop = "stop"
const val resume = "resume" const val resume = "resume"

@ -18,6 +18,7 @@ class DownloadService : BaseService() {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
intent?.action?.let { action -> intent?.action?.let { action ->
when (action) { when (action) {
Action.start -> download()
Action.stop -> stopSelf() Action.stop -> stopSelf()
} }
} }
@ -28,6 +29,10 @@ class DownloadService : BaseService() {
super.onDestroy() super.onDestroy()
} }
private fun download() {
}
/** /**
* 更新通知 * 更新通知
*/ */

Loading…
Cancel
Save