79734907

Date: 2025-08-14 02:55:45
Score: 0.5
Natty:
Report link

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]

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: hijakd