From 62bd71ac256ee66229ddadd645f736176142e58b Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 20 Aug 2019 16:30:56 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/readbook/ReadBookViewModel.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt index 5fad1c557..ade57d777 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt @@ -13,6 +13,7 @@ import io.legado.app.data.entities.BookChapter import io.legado.app.data.entities.BookSource import io.legado.app.help.BookHelp import io.legado.app.model.WebBook +import io.legado.app.service.ReadAloudService import io.legado.app.ui.widget.page.TextChapter import kotlinx.coroutines.Dispatchers.IO @@ -133,6 +134,11 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { } + override fun onCleared() { + super.onCleared() + ReadAloudService.stop(context) + } + interface CallBack { fun loadContentFinish(bookChapter: BookChapter, content: String) }