Currently, I was trying to use FLAG_IMMUTABLE for PendingIntent.getActivity(For android 12). However, it doesn't work (The parameter set in PendingIntent is null). If I replace it with FLAG_MUTABLE, it does work.
PendingIntent.getService(activity, 0, myServiceRequestIntent, PendingIntent.FLAG_ONE_SHOT or PendingIntent.FLAG_MUTABLE)
According to google docs, FLAG_IMMUTABLE is recommended way to pass pending intent. Are there some conditions or situations where you cannot use FLAG_IMMUTABLE? If there are examples of tips that will be really helpful
The additional_extra extra is null when I pass it back in the following format.
val pendingIntent = intent.getParcelableExtra("pending_intent")
val intent = Intent().apply {
putExtra("additional_extra", "test")
}
pendingIntent?.send(this, 0, intent)