根据https://developer.android.com/training/notify-user/build-notification#java我正在正确创建通知。
我期待的东西是:
我的代码是:
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context, "channel")
.setSmallIcon(R.drawable.wesay_not)
.setContentTitle(notification.title)
.setContentText(notification.description)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent)
.setChannelId(context.getString(R.string.channel_id));
并且drawable在那里:
但是设备显示的是默认的 android 设备,其他应用程序似乎显示图标正常: