通知未显示按钮图标

时间:2019-01-27 16:14:33

标签: java android

我想为通知中的“是”和“否”按钮设置图标。不幸的是,它不起作用。你能告诉我为什么吗?

                    NotificationCompat.Builder builder = new NotificationCompat.Builder(context, "default");
                    builder.setContentIntent(pendingIntent);
                    builder.setSmallIcon(R.drawable.logo);
                    builder.setContentTitle("Hello");
                    builder.setContentText(powiadomienie);
                    builder.setAutoCancel(true);
                    builder.addAction(R.drawable.yes, "Yes", yesIntent);
                    builder.addAction(R.drawable.no, "No", noIntent);
                    Notification notification = builder.build();
                    notification.flags |= NotificationCompat.FLAG_AUTO_CANCEL;
                    notificationManager.notify(id, notification);

0 个答案:

没有答案