我正在尝试为我的应用显示通知图标。对于所有操作系统版本和设备,除了配备Android 7的三星设备外,它的工作正常。
图标在中间是完全白色和透明的,因此在这里不可见。
这是我用来显示图标的代码。
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);
这是导致问题的图标。图标的大小不合适。