// Set the color.
notificationBuilder.setColor(getColor(R.color.red_notification_icon))
- // Prevent swiping to dismiss the notification.
+ // Prevent swiping to dismiss the notification. This no longer works (except on the lock screen) in API >= 34.
notificationBuilder.setOngoing(true)
// Start the foreground notification.
// Set the color.
antiquatedNetworkNotificationBuilder.setColor(getColor(R.color.red_notification_icon))
- // Prevent swiping to dismiss the notification.
+ // Prevent swiping to dismiss the notification. This no longer works (except on the lock screen) in API >= 34.
antiquatedNetworkNotificationBuilder.setOngoing(true)
// Update the notification.
// Set the color.
insecureNetworkNotificationBuilder.setColor(getColor(R.color.yellow_notification_icon))
- // Prevent swiping to dismiss the notification.
+ // Prevent swiping to dismiss the notification. This no longer works (except on the lock screen) in API >= 34.
insecureNetworkNotificationBuilder.setOngoing(true)
// Update the notification.
// Set the color.
secureNetworkNotificationBuilder.setColor(getColor(R.color.blue_icon))
- // Prevent swiping to dismiss the notification.
+ // Prevent swiping to dismiss the notification. This no longer works (except on the lock screen) in API >= 34.
secureNetworkNotificationBuilder.setOngoing(true)
// Update the notification.