有没有办法在通知服务的通知中触发操作?

时间:2015-02-19 11:38:41

标签: android android-intent notifications android-notifications

我正在Android中编写通知服务,目前正在阅读和解除此通知服务的所有通知。

Bundle extras = mNotification.extras;

title = extras.getString(Notification.EXTRA_TITLE);
notificationLargeIcon = (Bitmap) extras
                        .getParcelable(Notification.EXTRA_LARGE_ICON);
smallContents = extras
                        .getCharSequence(Notification.EXTRA_TEXT);

为了回复通知,有一种方法可以触发"回复"行动?我可以访问通知操作,但我不确定如何从Notification服务中触发操作。

Notification.Action[] actions = mNotification.actions;

1 个答案:

答案 0 :(得分:0)

如果通知是推送的,您可以在收到通知时进行回复(onMessage)。 如果是您的应用程序生成本地通知,则更清楚的是您不应该生成它们。相反,你必须直接回复

相关问题