【问题标题】:Notification icon not displayed in samsung Android 7三星 Android 7 中不显示通知图标
【发布时间】: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


【解决方案1】:

这是导致问题的图标。图标的大小不合适。

【讨论】:

    猜你喜欢
    • 2017-06-24
    • 2013-07-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-12
    • 1970-01-01
    • 2019-02-10
    • 1970-01-01
    相关资源
    最近更新 更多