pull/34/head
kunfei 5 years ago
parent c698b55399
commit 365c17b52b
  1. 6
      app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt

@ -24,11 +24,7 @@ class MediaButtonReceiver : BroadcastReceiver() {
val intentAction = intent.action
LogUtils.log("耳机按键: $intentAction")
if (Intent.ACTION_MEDIA_BUTTON == intentAction) {
val event =
intent.getParcelableExtra<KeyEvent>(Intent.EXTRA_KEY_EVENT) ?: return false
val action = event.action
val action = intent.getParcelableExtra<KeyEvent>(Intent.EXTRA_KEY_EVENT)?.action
if (action == KeyEvent.ACTION_DOWN) {
readAloud(context)
return true

Loading…
Cancel
Save