Skip to content

Instantly share code, notes, and snippets.

@garg-lucifer
Created September 24, 2022 08:08
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 garg-lucifer/57cf4cf45ad451c22d5ff278099232c1 to your computer and use it in GitHub Desktop.
Save garg-lucifer/57cf4cf45ad451c22d5ff278099232c1 to your computer and use it in GitHub Desktop.
private fun createNotificationChannel() {
val importance = NotificationManager.IMPORTANCE_HIGH
val channel = NotificationChannel("to_do_list", "Tasks Notification Channel", importance).apply {
description = "Notification for Tasks"
}
val notificationManager = activity?.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(channel)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment