Skip to content

Instantly share code, notes, and snippets.

@tbatsuur
Created October 20, 2018 21:29
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 tbatsuur/4d741b7dcc3415f649cd1ee8aea7fb0e to your computer and use it in GitHub Desktop.
Save tbatsuur/4d741b7dcc3415f649cd1ee8aea7fb0e to your computer and use it in GitHub Desktop.
notificationBuilder = NotificationCompat.Builder(this)
notificationBuilder.setAutoCancel(true)
.setDefaults(Notification.DEFAULT_ALL)
.setWhen(System.currentTimeMillis())
.setSmallIcon(R.mipmap.ic_launcher)
.setTicker("Hearty365")
.setContentTitle(notification.title)
.setContentText(notification.body)
.setSound(soundUri)
.setContentIntent(pendingIntent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment