来自文档 http://developer.android.com/reference/android/app/NotificationManager.html#notify%28java.lang.String,%20int,%20android.app.Notification%29 of the NotificationManager
在安卓中:
public void notification(int id,Notification通知)
发布要在状态栏中显示的通知。如果您的应用程序已发布具有相同 ID 的通知且尚未取消,则该通知将被更新后的信息替换。
it will be replaced by the updated information.
我不希望旧信息被替换,我想要两个通知。
注意:每个通知都有自己的 ID:
notificationManager.notify(0, notification);
notificationManager.notify(1, notification);
这个怎么做?
堆叠您的通知
如果您的应用程序创建了一个通知,而另一个相同类型的通知仍处于待处理状态,请避免创建全新的通知对象。相反,堆叠通知。
堆叠通知构建摘要描述,并允许用户了解有多少特定类型的通知正在等待处理。
http://developer.android.com/design/patterns/notifications.html http://developer.android.com/design/patterns/notifications.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)