添加程序结束判断,所有activity和service都结束

pull/1114/head
gedoor 3 years ago
parent 15d70507c3
commit 68ccd24681
  1. 2
      app/src/main/java/io/legado/app/help/LifecycleHelp.kt

@ -4,6 +4,7 @@ import android.app.Activity
import android.app.Application import android.app.Application
import android.os.Bundle import android.os.Bundle
import io.legado.app.base.BaseService import io.legado.app.base.BaseService
import io.legado.app.help.coroutine.Coroutine
import io.legado.app.utils.LanguageUtils import io.legado.app.utils.LanguageUtils
import java.lang.ref.WeakReference import java.lang.ref.WeakReference
import java.util.* import java.util.*
@ -110,6 +111,7 @@ object LifecycleHelp : Application.ActivityLifecycleCallbacks {
} }
private fun onFinished() { private fun onFinished() {
Coroutine.cancel()
finishedListener?.invoke() finishedListener?.invoke()
} }
} }
Loading…
Cancel
Save