-
-
Save 5AbhishekSaxena/01d4cd88643ee476114ceac20a347df5 to your computer and use it in GitHub Desktop.
This file contains 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
private fun buildSimpleNotification(): Notification { | |
val pendingIntent: PendingIntent = getPendingIntent() | |
val builder = NotificationCompat.Builder(this, CHANNEL_ID) | |
.setSmallIcon(R.drawable.ic_android_black_24dp) | |
.setContentTitle("Sample notification") | |
.setContentText("This is the long content of the notification. Happy coding.") | |
.setStyle( | |
NotificationCompat.BigTextStyle() | |
.bigText("This is much bigger content of the notification. Happy coding!") | |
) | |
.setPriority(NotificationCompat.PRIORITY_HIGH) | |
.setContentIntent(pendingIntent) | |
return builder.build() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment