Last active
January 4, 2020 19:33
-
-
Save Lavanyagaur22/b6347d67a6d3c9b56b89de7e155b031d 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 i = Intent() | |
i.action = Intent.ACTION_VIEW | |
i.data = Uri.parse("https://www.google.com") | |
val pi: PendingIntent = | |
PendingIntent.getActivity(this, 12345, i, PendingIntent.FLAG_UPDATE_CURRENT) | |
val actionedNotification = NotificationCompat.Builder(this, "first") | |
.setSmallIcon(R.drawable.ic_launcher_foreground) | |
.setContentTitle("Hello There") | |
.setContentText("General Master!") | |
.addAction(R.mipmap.ic_launcher, "Snooze", pi) | |
.setPriority(NotificationCompat.PRIORITY_DEFAULT).build() | |
nm.notify(4, actionedNotification) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment