安卓:添加一个状态栏通知的按钮状态栏、按钮、通知

2023-09-04 12:35:14 作者:今生共相伴

我想创建具有除了文本的按钮自定义状态栏通知中的Andr​​oid。该按钮可以做不同的事情莫过于当你点击该通知本身。 这是可能的吗?我也没事把一个按钮的图像有代替。我知道如何把图像,但不知道如何处理的OnClick嵌入在RemoteViews的图像。你的帮助是真诚的AP preciated。

I am trying to create a custom status bar notification in Android that has a button in addition to the text. The button can do a different thing than when you click the notification itself. Is this possible at all? I'd also be ok putting an image of a button there instead. I know how to put an image, but not sure how to handle OnClick for an image embedded in RemoteViews. Your help is sincerely appreciated.

感谢很多提前。

推荐答案

我不认为你可以在状态栏本身就是一个按钮,但你一定可以做到这一点使用自定义扩展视图(见的 http://developer.android.com/guide/topics/ui/notifiers/notifications.html )

I don't think you can get a button on the status bar itself but you can certainly do it using a Custom Expanded View (see http://developer.android.com/guide/topics/ui/notifiers/notifications.html)