Last active
January 4, 2020 19:03
-
-
Save Lavanyagaur22/f8ce99f34c62563fa0475990402e28b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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