我最近将我的应用程序更新到了API26,通知不再起作用,甚至没有改变代码.
val notification = NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_notification)
.setContentTitle("Title")
.setContentText("Text")
.build()
(getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager).notify(1, notification)
为什么不起作用?API是否有一些我不知道的变化?