我正在尝试显示我的应用程序的通知图标。在所有的操作系统版本和设备上,它都运行得很好,除了搭载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);发布于 2017-12-29 20:18:17
是这个图标导致了这个问题。图标的要求大小不正确。
https://stackoverflow.com/questions/48007855
复制相似问题