-
-
Save Arunshaik2001/49fec03dd2eea729d05b1f23a6c95a69 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
fun createNotificationWithLargeIcon(context: Context){ | |
val icon = BitmapFactory.decodeResource( | |
context.resources, | |
R.drawable.aquarium | |
) | |
val notification = NotificationCompat.Builder(context, NotificationChannels.CHANNEL1) | |
.setSmallIcon(R.drawable.desk) | |
.setContentTitle("imageTitle") | |
.setContentText("imageDescription") | |
.setStyle(NotificationCompat.BigPictureStyle() | |
.bigPicture(icon)) | |
.build() | |
with(NotificationManagerCompat.from(context)) { | |
notify(1234567, notification) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment