Skip to content

Instantly share code, notes, and snippets.

@Lavanyagaur22
Last active January 4, 2020 18:59
Show Gist options
  • Save Lavanyagaur22/ad57f7b637eb986744842e18dabc6a1d to your computer and use it in GitHub Desktop.
Save Lavanyagaur22/ad57f7b637eb986744842e18dabc6a1d to your computer and use it in GitHub Desktop.
//Create a simple notification, first - > Channel ID
val simpleNotification = NotificationCompat.Builder(this, "first")
.setSmallIcon(R.drawable.ic_launcher_foreground)
.setContentTitle("Hello There")
.setContentText("General Master!")
.setPriority(NotificationCompat.PRIORITY_DEFAULT).build()
//Show the notification, nm is the NotificationManager object
nm.notify(id, simpleNotification)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment