I recently upgraded my application to API 26, and notifications no longer work without even changing the code.
val notification = NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_notification)
.setContentTitle("Title")
.setContentText("Text")
.build()
(getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager).notify(1, notification)
Why doesn't it work? Have there been some API changes that I don't know about?
Aaron source
share