What happens if you set the flag on a PendingIntent to 0?
Asked Answered
I

1

12

What exactly happens when you set the flag on a pending intent to 0? Does it just not raiise a flag or does it default to one of the others?

Infuse answered 23/12, 2010 at 23:57 Comment(0)
W
8

No this is the "default" behavior of creating a new PendingIntent regardless if one already exists or not. If you want more specialized behavior, like cancel an existing PendingIntent if the underlying Intent is the same, or update such an existing PendingIntent, then you should use the various flags you can find in the PendingIntent class.

Warren answered 24/12, 2010 at 4:18 Comment(1)
Actually this is wrong :-( The default behaviour (setting no flags, ie: 0 as the flags parameter) is to return an existing PendingIntent if there is one that matches the parameters provided. If there is no existing matching PendingIntent then a new one will be created and returned.Douce

© 2022 - 2024 — McMap. All rights reserved.