Skip to content

Instantly share code, notes, and snippets.

@Arunshaik2001
Created November 23, 2022 15:27
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/93fb490922c404c9fdf7c80fbc91a324 to your computer and use it in GitHub Desktop.
Save Arunshaik2001/93fb490922c404c9fdf7c80fbc91a324 to your computer and use it in GitHub Desktop.
private fun createBubbleMetadata(
contentUri: Uri,
icon: IconCompat
): NotificationCompat.BubbleMetadata {
val bubbleIntent =
PendingIntent.getActivity(
context,
REQUEST_BUBBLE,
Intent(context, MainActivity3::class.java)
.setAction(Intent.ACTION_VIEW)
.setData(contentUri),
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE
)
val builder = NotificationCompat.BubbleMetadata.Builder(bubbleIntent, icon)
return builder
.setDesiredHeightResId(R.dimen.bubble_height)
.setAutoExpandBubble(true)
.setSuppressNotification(true)
.build()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment