gpt4 book ai didi

android - 我可以在通知中切换操作的标题吗?

转载 作者:行者123 更新时间:2023-11-30 03:49:21 25 4
gpt4 key购买 nike

在我的通知栏中,我想切换一个 Action 的标题,这是我用通知生成器添加的。有切换的选项吗?我测试了以下代码

 notification.addAction(R.drawable.ic_delete, isIgnored?"ignor":"accept", pendingIgnoreEventIntent);

但是如果我使用 .build() 构建通知,则只显示文本,这是在第一次构建之后设置的。

有人有想法吗?问候

最佳答案

From the docs :

To set up a notification so it can be updated, issue it with a notification ID by calling NotificationManager.notify(ID, notification). To update this notification once you've issued it, update or create a NotificationCompat.Builder object, build a Notification object from it, and issue the Notification with the same ID you used previously. If the previous notification is still visible, the system updates it from the contents of the Notification object. If the previous notification has been dismissed, a new notification is created instead.

关于android - 我可以在通知中切换操作的标题吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14402872/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com