简体   繁体   English

什么是让Android Wear刷新媒体通知的正确方法?

[英]What's the right way to get Android Wear to refresh a media notification?

I have an app that plays music; 我有一个可以播放音乐的应用程序; I have a Broadcast Receiver that properly handles the commands from Android wear like KEYCODE_MEDIA_PLAY , KEYCODE_MEDIA_PAUSE , and KEYCODE_MEDIA_NEXT . 我有一个广播接收器,可以正确处理来自Android设备的命令,例如KEYCODE_MEDIA_PLAYKEYCODE_MEDIA_PAUSEKEYCODE_MEDIA_NEXT

Everything works, but there's one issue: when I hit Play on the Wear notification, the Intent is fired, the music plays, but the notification isn't updated to show a 'Pause' icon until I swipe down and back up again, forcing the notification to be "refreshed." 一切正常,但是有一个问题:当我在Wear通知中点击“播放”时,Intent被触发,音乐会播放,但是通知不会更新为显示“ Pause”(暂停)图标,直到我向下滑动并再次向上备份,强制通知将被“刷新”。 This issue does not occur on the phone. 在电话上不会发生此问题。 Is there a way to prompt this "refresh" to occur while the notification is active on the screen? 当通知在屏幕上处于活动状态时,是否有办法提示此“刷新”发生?

事实证明,此行为实际上是Android Wear中的错误,因为它似乎已在5.0.2更新中修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM