转自:http://blog.csdn.net/sergeycao/article/details/8151957
APP发送通知后,点击clear按钮,如何让通知不被清除?或者点击通知后,通知不消失?
APP发送通知时,通知需要添加flag:
Notification notification;
notification.flags |= Notification.FLAG_ONGOING_EVENT;
或者
notification.flags |= Notification.FLAG_NO_CLEAR;
PendingIntent.FLAG_CANCEL_CURRENT;
PendingIntent.FLAG_NO_CREATE;
PendingIntent.FLAG_ONE_SHOT;
PendingIntent.FLAG_UPDATE_CURRENT;
本文探讨了在Android应用中发送通知时,如何通过设置特定标志和使用PendingIntent来实现通知不被清除或消失的效果。通过添加Notification.FLAG_ONGOING_EVENT或Notification.FLAG_NO_CLEAR,以及正确配置PendingIntent,开发者可以控制通知的行为,提供更持久的通知体验。

3436

被折叠的 条评论
为什么被折叠?



