我正在尝试在装有 Android 6.0.1 的 Nexus 7 上显示通知操作,但没有显示。是因为操作系统吗?我已经测试了带有 Android 7.0 的 S6 edge,它看起来很完美。
NotificationCompat.Builder(this, resources.getString(R.string.default_notification_channel_id))
.setSmallIcon(R.mipmap.ic_launcher_round)
.setContentIntent(pIntent)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.addAction(NotificationCompat.Action(R.mipmap.ic_launcher, resources.getString(R.string.confirm_action_notification), yesPendingIntent))
.addAction(NotificationCompat.Action(R.mipmap.ic_launcher, resources.getString(R.string.deny_action_notification), noPendingIntent))
.setPriority(PRIORITY_MAX)
.setDefaults(Notification.DEFAULT_VIBRATE)
.setCustomHeadsUpContentView(headsUpView)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setCustomContentView(collapsedView)
.setCustomBigContentView(expandedView)
.setStyle(NotificationCompat.DecoratedCustomViewStyle())
.setPublicVersion(privateNotification)
.build()