【发布时间】:2018-04-17 06:21:41
【问题描述】:
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this, channelId)
.setSmallIcon(R.drawable.schedule)
.addAction(R.drawable.icon,"action test",pi)
.setStyle(new NotificationCompat.BigTextStyle().bigText(body))
.setContentTitle(title)
.setContentText(body);
以上代码创建通知并向其添加一个操作(按钮)。我希望我的按钮不显示图标,但我不知道该怎么做,因为参数addAction 中的icon 是必需的,并且不能为空。
甚至可以在没有任何图标的情况下向通知添加操作按钮(顺便说一句,操作按钮上的图标似乎甚至没有显示在牛轧糖和奥利奥上)。
【问题讨论】:
标签: java android notifications icons action