diff --git a/library/src/main/java/tw/dcard/bubblemock/module/BubbleBuilder.kt b/library/src/main/java/tw/dcard/bubblemock/module/BubbleBuilder.kt index 527ff1a..02c115e 100644 --- a/library/src/main/java/tw/dcard/bubblemock/module/BubbleBuilder.kt +++ b/library/src/main/java/tw/dcard/bubblemock/module/BubbleBuilder.kt @@ -78,12 +78,16 @@ class BubbleBuilder( } private fun getPendingIntent(): PendingIntent { + val flags = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + PendingIntent.FLAG_MUTABLE or PendingIntent.FLAG_UPDATE_CURRENT + } else { + PendingIntent.FLAG_UPDATE_CURRENT + } return PendingIntent.getActivity( context, 0, - Intent(context, BubbleActivity::class.java) - .setAction(Intent.ACTION_VIEW), - PendingIntent.FLAG_UPDATE_CURRENT + Intent(context, BubbleActivity::class.java).setAction(Intent.ACTION_VIEW), + flags ) }