From dea4ab709f9b33bc303c9313820a7841221c50f0 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 18 Sep 2019 22:38:59 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/receiver/MediaButtonReceiver.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt b/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt index 5d3519c22..ea4e91d4e 100644 --- a/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt +++ b/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt @@ -22,10 +22,10 @@ class MediaButtonReceiver : BroadcastReceiver() { fun handleIntent(context: Context, intent: Intent): Boolean { val intentAction = intent.action - LogUtils.log("耳机按键: $intentAction") + val keyEventAction = intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT)?.action + LogUtils.log("耳机按键: $intentAction $keyEventAction") if (Intent.ACTION_MEDIA_BUTTON == intentAction) { - val action = intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT)?.action - if (action == KeyEvent.ACTION_DOWN) { + if (keyEventAction == KeyEvent.ACTION_DOWN) { readAloud(context) return true }