首页 > 解决方案 > 状态栏上的通知小图标为每个通知创建

问题描述

我正在创建一个通知

mNotifyBuilder.setContentTitle(envelope.getSubjectWithDefault(context.getString(R.string.no_subject)))
                .setTicker(sybject)
                .setSmallIcon(icon)
                .setContentInfo(name)
                .setDeleteIntent(PendingIntent.getBroadcast(context, (int) id, deleteIntent, PendingIntent.FLAG_CANCEL_CURRENT))
                .setContentIntent(PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT))
                .setAutoCancel(true)
                .setNumber(count)
                .setGroup(group)
                .addAction(reply)
                .addAction(cancel, context.getString(R.string.delete), dismiss)
                .setPriority(NotificationCompat.PRIORITY_MAX)
                .setStyle(new NotificationCompat.BigTextStyle()
                        .bigText(text))
                .setContentText(text);
String noti = Context.NOTIFICATION_SERVICE;
        NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(noti);
        mNotificationManager.notify((int) id, notify);

但有些手机会在状态栏上为每次推送创建自己的小图标。我如何才能找到或可以更改代码以修复此类通知以使其正常工作?

标签: androidnotificationsiconsstatusbar

解决方案


推荐阅读