三星Android 7中未显示通知图标

时间:2017-12-28 12:50:13

标签: notifications material-design samsung-mobile android-7.0-nougat

我正在尝试为我的应用显示通知图标。对于所有操作系统版本和设备,除了配备Android 7的三星设备外,它的工作正常。

enter image description here

状态栏中的通知图标。 enter image description here

这是我正在显示的实际通知图标。 enter image description here

图标在中间是完全白色且透明的,因此在此处不可见。

以下是我用来显示图标的代码。

Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder =
                new NotificationCompat.Builder(getApplicationContext())
                        .setSmallIcon(R.drawable.ic_comment)
                        .setContentTitle(messageMap.get(MESSAGE_KEY_NOTIFICATION))
                        .setSubText(getTitle(eventType))
                        .setAutoCancel(true)
                        .setColor(getResources().getColor(R.color.primary_blue))
                        .setSound(defaultSoundUri)
                        .setContentIntent(getPendingIntent(eventType))
                        .setGroup(GROUP_ID_TEAM_INVITATION);

1 个答案:

答案 0 :(得分:0)

这是造成问题的图标。图标的大小不合适。