【发布时间】:2018-06-09 00:34:28
【问题描述】:
我正在尝试为我的应用显示通知图标。对于所有操作系统版本和设备,除了搭载 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);
【问题讨论】:
-
点击图标图片查看。
-
为什么要审查通知? 即使你审查它也很容易看到它!
标签: notifications material-design samsung-mobile android-7.0-nougat