Skip to content

Instantly share code, notes, and snippets.

@Arunshaik2001
Created November 21, 2022 14:01
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 Arunshaik2001/8e5e90f5b2e0c9789ab0cf759dcea7f6 to your computer and use it in GitHub Desktop.
Save Arunshaik2001/8e5e90f5b2e0c9789ab0cf759dcea7f6 to your computer and use it in GitHub Desktop.
fun createNotificationWithLargeText(context: Context){
val icon = BitmapFactory.decodeResource(
context.resources,
R.drawable.aquarium
)
val notification = NotificationCompat.Builder(context, NotificationChannels.CHANNEL1)
.setSmallIcon(R.drawable.desk)
.setContentTitle("Joe")
.setContentText("Lending Money")
.setLargeIcon(icon)
.setStyle(NotificationCompat.BigTextStyle()
.bigText("long long long long long long long long long long text "))
.build()
with(NotificationManagerCompat.from(context)) {
notify(12544567, notification)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment