我的应用会在上传文档并成功上传时发布通知。如果发布多个文档上传,它会在android通知栏上发布一系列应用图标。
private void updateNotification(String title, String fileId) {
Log.v(TAG, "Updating notification for '" + fileId + "' with content: '" + title + "'");
ApplicationSettings applicationSettings = new ApplicationSettings(mContext);
NotificationManager notifyManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext);
builder.setContentTitle(title)
.setContentText(fileId)
.setSubText(applicationSettings.getAccountEmail())
.setSmallIcon(R.drawable.upload_notification);
// Issue the notification
notifyManager.notify(fileId.hashCode() /*notificationId*/, builder.build());
}
如何在一个通知图标下将我在Android中的所有应用通知分组?
我正在寻找类似的东西: