pull/32/head
kunfei 5 years ago
parent 2a2ed2d3f9
commit 993f7fb7f0
  1. 5
      app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt

@ -8,7 +8,6 @@ import io.legado.app.constant.Bus
import io.legado.app.help.ActivityHelp import io.legado.app.help.ActivityHelp
import io.legado.app.ui.readbook.ReadBookActivity import io.legado.app.ui.readbook.ReadBookActivity
import io.legado.app.utils.postEvent import io.legado.app.utils.postEvent
import org.jetbrains.anko.startActivity
/** /**
@ -48,7 +47,9 @@ class MediaButtonReceiver : BroadcastReceiver() {
private fun readAloud(context: Context) { private fun readAloud(context: Context) {
ActivityHelp.isExist(ReadBookActivity::class.java).let { ActivityHelp.isExist(ReadBookActivity::class.java).let {
if (!it) { if (!it) {
context.startActivity<ReadBookActivity>() val intent = Intent(context, ReadBookActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(intent)
} }
} }
postEvent(Bus.READ_ALOUD, true) postEvent(Bus.READ_ALOUD, true)

Loading…
Cancel
Save