diff --git a/android/app/src/main/kotlin/com/carriez/flutter_hbb/MainService.kt b/android/app/src/main/kotlin/com/carriez/flutter_hbb/MainService.kt index 88f31dca3..90e8ce05d 100644 --- a/android/app/src/main/kotlin/com/carriez/flutter_hbb/MainService.kt +++ b/android/app/src/main/kotlin/com/carriez/flutter_hbb/MainService.kt @@ -560,7 +560,11 @@ class MainService : Service() { addCategory(Intent.CATEGORY_LAUNCHER) putExtra("type", type) } - val pendingIntent = PendingIntent.getActivity(this, 0, intent, FLAG_UPDATE_CURRENT) + val pendingIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + PendingIntent.getActivity(this, 0, intent, FLAG_UPDATE_CURRENT or FLAG_IMMUTABLE) + } else { + PendingIntent.getActivity(this, 0, intent, FLAG_UPDATE_CURRENT) + } val notification = notificationBuilder .setOngoing(true) .setSmallIcon(R.mipmap.ic_launcher)