I suspect that when you are setting the Icon in "displayNotification()" could be the culprit
private fun displayNotification(){
...
// set the small icon using the Icon created from bitmap (API 23+)
builder.setSmallIcon(Icon.createWithBitmap(bitmap))
.setContentTitle("Simple Notification")
...
}
it looks like your createWithBitmap() function could be repeatedly called by the builder, maybe assign Icon.createWithBitmap() to a variable outside of the builder?
ie:
val bitmapIcon = Icon.createWithBitmap(bitmap)
builer.setSmallIcon(bitmapIcon)
[im guessing a little here, im still learning kotlin]