如何添加按钮,通知中的android? [英] How to add button to notifications in android?

查看:165
本文介绍了如何添加按钮,通知中的android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序从屏幕(或generall在屏幕上平板电脑的右下角)的顶部刷卡播放音乐,当用户打开通知屏幕,我想present他们一个按钮来停止当前播放音乐再次启动它,如果他们想要的。

My app plays music and when users open notifications screen by swiping from the top of the screen ( or generall from the bottom right of the screen on tablets ), i want to present them a button to stop the currently playing music and start it again if they want.

我不打算把对用户的主屏幕上一个小部件,但只是到通知。我怎样才能做到这一点?

I am not planning to put a widget on user's homescreen, but just into notifications. How can i do this?

推荐答案

从API级别4.1,您可以添加动作按钮通知。要查看基础关于通知检查机器人DOC

from api level 4.1 you can add action buttons to notification. To see the basics about notification check the android doc.

和一些更多的帮助,您可以检查此如此回答和的this教程

And for some more help you can check this so answer and this tutorial

这篇关于如何添加按钮,通知中的android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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