How can I create unique pending intents with same requestCode and then cancel them? I would like to separate them with UUID for example. Documentation says that by adding extra doesn't make them unique maybe I could setData with my generated string UUID?
this is only option I came up with, but not sure if it would work:
val intent = Intent(context, cls)
val uniqueId = Uri.parse("dedf788c-ecd7-43f4-a691-03e2117fd50e")
intent.data = uniqueId
val pendingIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
this question maybe a duplicate of this.
Your requestCode must be unique otherwise PendingIntent will be updated to last intent if you use the same requestCode(old Api <22).
If your are not using action, you can add your UUID as de dummy action to make them unique. You have to store the requestCode to be able to cancel old PendingIntent.