diff --git a/app/src/main/java/io/legado/app/App.kt b/app/src/main/java/io/legado/app/App.kt index c72c5133c..f1da4ab01 100644 --- a/app/src/main/java/io/legado/app/App.kt +++ b/app/src/main/java/io/legado/app/App.kt @@ -144,13 +144,13 @@ class App : Application() { private fun registerActivityLife(){ registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks{ override fun onActivityPaused(activity: Activity) { - ActivityHelp.add(activity) } override fun onActivityResumed(activity: Activity) { } override fun onActivityStarted(activity: Activity) { + } override fun onActivityDestroyed(activity: Activity) { @@ -164,6 +164,7 @@ class App : Application() { } override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) { + ActivityHelp.add(activity) } }) diff --git a/app/src/main/java/io/legado/app/service/ReadAloudService.kt b/app/src/main/java/io/legado/app/service/ReadAloudService.kt index aad32d9d6..7ae517880 100644 --- a/app/src/main/java/io/legado/app/service/ReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/ReadAloudService.kt @@ -219,6 +219,7 @@ class ReadAloudService : BaseService(), TextToSpeech.OnInitListener, AudioManage } private fun pauseReadAloud(pause: Boolean) { + if (pause) postEvent(Bus.ALOUD_STATE, Status.PAUSE) this.pause = pause textToSpeech?.stop() ReadAloudNotification.upNotification(this)