我研究了这个,发现它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);
Run Code Online (Sandbox Code Playgroud)
文本似乎工作,但我把它留空了,因此在主图像下面有一个空的空间,其中应该显示图标
我的通知操作图标不会显示在android 7(N)中!这是Android 7的变化吗?我不能再使用它了吗?!当我在Android 7的Nexus 6P上运行我的应用程序(针对API23)时,我看到了这个问题.