Skip to content

Instantly share code, notes, and snippets.

@Lavanyagaur22
Last active January 4, 2020 19:03
Show Gist options
  • Save Lavanyagaur22/f8ce99f34c62563fa0475990402e28b6 to your computer and use it in GitHub Desktop.
Save Lavanyagaur22/f8ce99f34c62563fa0475990402e28b6 to your computer and use it in GitHub Desktop.
val icon = BitmapFactory.decodeResource(
this.resources,
R.drawable.ic_launcher_foreground
)
val not = NotificationCompat.Builder(this, "first")
.setSmallIcon(R.drawable.ic_launcher_foreground)
.setContentTitle("Hello There")
.setContentText("General Kenobi!")
.setLargeIcon(icon)
.setStyle(
NotificationCompat.BigPictureStyle()
.bigPicture(icon)
.bigLargeIcon(null)
)
.setPriority(NotificationCompat.PRIORITY_DEFAULT).build()
nm.notify(5, not)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment