【发布时间】:2017-01-06 10:45:43
【问题描述】:
我对此进行了研究,发现 addAction (int icon, CharSequence title, PendingIntent intent) 已被弃用,因此我使用了 addAction (Notification.Action action) 。在这两种情况下,图标都看不到。
NotificationCompat.Action action = new NotificationCompat.Action.Builder(R.drawable.ic_share, "", pendingIntent).build();
notificationBuilder.addAction(action);
文本似乎可以正常工作,但我将其留空,因此主图像下方有一个空白区域,应该显示图标
【问题讨论】:
-
.setStyle(new android.support.v4.media.app.NotificationCompat.MediaStyle()) 在notificationCompat对象中使用它然后你就可以看到图标了
标签: android android-notifications android-7.1-nougat