我正在尝试为我的应用显示通知图标。对于所有操作系统版本和设备,除了配备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);
答案 0 :(得分:0)
这是造成问题的图标。图标的大小不合适。