Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
PendingIntent sender = PendingIntent.getBroadcast(context, id.intValue(),
intent,android.os.Build.VERSION.SDK_INT >= 31?PendingIntent.FLAG_IMMUTABLE:PendingIntent.FLAG_UPDATE_CURRENT);//
android.os.Build.VERSION.SDK_INT >= 31?PendingIntent.FLAG_IMMUTABLE:PendingIntent.FLAG_UPDATE_CURRENT