如何添加一个按钮到通知?按钮、通知

由网友(回不去的远方)分享简介:我这样做是这样的:RemoteViews views = new RemoteViews(..);views.setOnClickPendingIntent(R.id.button1,pd);noti.contentviews = views;然后通知通知。我可以看到在通知中的按钮,但按键不能点击。当我按一...

我这样做是这样的:

RemoteViews views = new RemoteViews(..);
views.setOnClickPendingIntent(R.id.button1,pd);
noti.contentviews = views;

然后通知通知。 我可以看到在通知中的按钮, 但按键不能点击。 当我按一下按钮,整个通知的点击! 我该如何解决这个问题? 我发现到处这一点,但没有什么有用的发现的。 有人说,一些手机不支持通知按钮,  而三星Galaxy S,在musicplayer的通知有按钮单击事件。

and then notify the notification. I can see the button in the notification, but the button can't be clicked. When i click the button,the whole notification clicked! How can i resolve this question? I found everywhere for this,but nothing useful found. someone said, some phones don't support the notification button, but samsung galaxy s, the musicplayer's notification has button click event.

推荐答案

您不能把互动的小部件,如按钮,在通知并从中获取用户输入。这些是只输出显示。

You cannot put interactive widgets, like a Button, in a Notification and get user input from them. These are for output display only.

阅读全文

相关推荐

最新文章