Android的 - 音乐播放器在通知屏幕(顶部下拉屏) [英] Android - music player in the notification screen (top pull-down screen)

查看:327
本文介绍了Android的 - 音乐播放器在通知屏幕(顶部下拉屏)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将一个去在上面的下拉屏幕创建一个简单的音乐播放器(即,其中通知去)?我的手机上的默认的音乐播放器目前做到这一点,只是有一个简单的previous曲目,播放/暂停,下一首曲目按钮​​。

How would one go about creating a simple music player in the top pull-down screen (i.e. where the notifications go)? The default music player on my phone currently does this, and just has a simple previous track, play/pause, and next track buttons.

我已经知道如何使用挂起的意图,从那里发动独立的活动,我只是不知道如何获得更多的内容在那里,用户可以交互。

I already know how to use pending intent to launch a separate activity from up there, I'm just not sure how to get more content up there that the user can interact with.

希望我描述得很清楚。

感谢。

推荐答案

Android不支持使用有源元件的通知(如按钮),直到3.0。如果您的设备早于3.0版,制造商定制了它自己的应用程序,但这不支持第三方应用。

Android doesn't support notifications with active elements (such as buttons) until 3.0. If your device is older than 3.0, the manufacturer has customized it for their apps but this is not supported for third party apps.

由于3.0,你可以简单地把通知RemoteViews的意向发送回您的应用程序按钮,让你执行操作。

As of 3.0, you can simply put buttons in the notification RemoteViews that send intents back to your app to have you perform actions.

这篇关于Android的 - 音乐播放器在通知屏幕(顶部下拉屏)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆