From 75fce76f62225432b48cf79c4b21c6475623d1ce Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 25 Aug 2019 21:36:44 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/App.kt | 3 ++- app/src/main/java/io/legado/app/service/ReadAloudService.kt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) 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)