Skip to content

Instantly share code, notes, and snippets.

@hitherejoe
Created June 12, 2017 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hitherejoe/46c4747d54eab478d7262c617533dc22 to your computer and use it in GitHub Desktop.
Save hitherejoe/46c4747d54eab478d7262c617533dc22 to your computer and use it in GitHub Desktop.
val notificationManager =
getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
val id = "some_channel_id"
val name = getString(R.string.channel_name)
val description = getString(R.string.channel_description)
val importance = NotificationManager.IMPORTANCE_LOW
val channel = NotificationChannel(id, name, importance)
channel.description = description
channel.setShowBadge(true)
notificationManager.createNotificationChannel(channel)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment