Android Wear Notification with MediaSession

断了今生、忘了曾经 提交于 2019-12-06 05:21:09

One feature added in AppCompat v22.2.0 is NotificationCompat.MediaStyle - this gives you a backward compatible way to build media notifications and pass media information to Android 5.0+ devices, working alongside MediaSessionCompat to provide information to Android Wear on older devices (as well as adding lockscreen controls on API14-19 devices).

When you build a MediaStyle notification, it is critical to call setMediaSession() which tells Android Wear that your notification is attached to media playback, giving you the 4 action on a single card style notification.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!