pull/52/head
kunfei 5 years ago
parent f066a07aa0
commit 0f455acc97
  1. 2
      app/src/main/java/io/legado/app/service/DownloadService.kt
  2. 2
      app/src/main/java/io/legado/app/service/help/Download.kt

@ -79,7 +79,7 @@ class DownloadService : BaseService() {
builder.addAction( builder.addAction(
R.drawable.ic_stop_black_24dp, R.drawable.ic_stop_black_24dp,
getString(R.string.cancel), getString(R.string.cancel),
IntentHelp.servicePendingIntent<WebService>(this, Action.stop) IntentHelp.servicePendingIntent<DownloadService>(this, Action.stop)
) )
builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC) builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
val notification = builder.build() val notification = builder.build()

@ -2,12 +2,14 @@ package io.legado.app.service.help
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import io.legado.app.constant.Action
import io.legado.app.service.DownloadService import io.legado.app.service.DownloadService
object Download { object Download {
fun start(context: Context, bookUrl: String, start: Int, end: Int) { fun start(context: Context, bookUrl: String, start: Int, end: Int) {
Intent(context, DownloadService::class.java).let { Intent(context, DownloadService::class.java).let {
it.action = Action.start
it.putExtra("bookUrl", bookUrl) it.putExtra("bookUrl", bookUrl)
it.putExtra("start", start) it.putExtra("start", start)
it.putExtra("end", end) it.putExtra("end", end)

Loading…
Cancel
Save