diff --git a/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt b/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt index e3219d1a4..c70c06388 100644 --- a/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt @@ -1,6 +1,7 @@ package io.legado.app.service import android.app.PendingIntent +import android.content.Intent import android.media.MediaPlayer import io.legado.app.constant.EventBus import io.legado.app.help.AppConfig @@ -36,6 +37,11 @@ class HttpReadAloudService : BaseReadAloudService(), mediaPlayer.setOnCompletionListener(this) } + override fun onTaskRemoved(rootIntent: Intent?) { + super.onTaskRemoved(rootIntent) + stopSelf() + } + override fun onDestroy() { super.onDestroy() task?.cancel()