pull/32/head
kunfei 5 years ago
parent 9a5758634c
commit 75fce76f62
  1. 3
      app/src/main/java/io/legado/app/App.kt
  2. 1
      app/src/main/java/io/legado/app/service/ReadAloudService.kt

@ -144,13 +144,13 @@ class App : Application() {
private fun registerActivityLife(){ private fun registerActivityLife(){
registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks{ registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks{
override fun onActivityPaused(activity: Activity) { override fun onActivityPaused(activity: Activity) {
ActivityHelp.add(activity)
} }
override fun onActivityResumed(activity: Activity) { override fun onActivityResumed(activity: Activity) {
} }
override fun onActivityStarted(activity: Activity) { override fun onActivityStarted(activity: Activity) {
} }
override fun onActivityDestroyed(activity: Activity) { override fun onActivityDestroyed(activity: Activity) {
@ -164,6 +164,7 @@ class App : Application() {
} }
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) { override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
ActivityHelp.add(activity)
} }
}) })

@ -219,6 +219,7 @@ class ReadAloudService : BaseService(), TextToSpeech.OnInitListener, AudioManage
} }
private fun pauseReadAloud(pause: Boolean) { private fun pauseReadAloud(pause: Boolean) {
if (pause) postEvent(Bus.ALOUD_STATE, Status.PAUSE)
this.pause = pause this.pause = pause
textToSpeech?.stop() textToSpeech?.stop()
ReadAloudNotification.upNotification(this) ReadAloudNotification.upNotification(this)

Loading…
Cancel
Save