To correct my previous statement, PendingIntents are cached by the
system, not Intents. The note about how to differentiate Intents
still holds though, so if you need to replace a current PendingIntent
with a new PI that has a new Intent that only differs by its Extras,
be sure to use the flag FLAG_CANCEL_CURRENT so that the cached PI is
not used.
>From Intent.filterEquals(o):
Returns true if action, data, type, class, and categories are the
same. <== note does not include Extras
>From PendingIntents javadoc:
* <p>A PendingIntent itself is simply a reference to a token
maintained by
* the system describing the original data used to retrieve it. This
means
* that, even if its owning application's process is killed, the
* PendingIntent itself will remain usable from other processes that
* have been given it. If the creating application later re-retrieves
the
* same kind of PendingIntent (same operation, same Intent action,
data,
* categories, and components, and same flags), it will receive a
PendingIntent
* representing the same token if that is still valid, and can thus
call
* {...@link #cancel} to remove it.
On Mar 25, 7:48 am, "Blake B." <[email protected]> wrote:
> Intents are cached by the system, and two Intents are not
> differentiated by their Extras. So your two intents look like the
> same Intent and the second one is being tossed out. You must differ
> Intents by their Action/Data/Category. I will sometimes use the Data
> field to hold a simple ID that is not really a URI to make two intents
> appear different. Look at the code for Intent.equals() I believe, and
> you will see that Extras are not considered.
>
> On Mar 24, 12:47 pm, "info+farm" <[email protected]> wrote:
>
> > Are not Google developers looking into this forum anymore?
>
> > Then, I will be missing the detailed answers.
>
> > Regards,
> > info+farm
>
> > On Mar 24, 3:17 pm, "info+farm" <[email protected]> wrote:
>
> > > Hello Mr. Murphy,
>
> > > I searched for it before sending my post and looked at
>
> > >http://groups.google.com/group/android-developers/browse_thread/threa...
> > > andhttp://groups.google.com/group/android-developers/browse_thread/threa...
>
> > > But both of them could not find the answer to the problem.
>
> > > I am afraidPendingIntenthas different Intent initialization(start
> > > ()), from the normal startActivity().
>
> > > I am a little bit confused,
>
> > > Regards,
> > > info+farm
>
> > > On Mar 23, 11:32 pm, Mark Murphy <[email protected]> wrote:
>
> > > > info+farm wrote:
> > > > > Am I the only one who is having this problem?
> > > > > Actually, I am going to find a workaround for this problem, but I
> > > > > would like to know what I am doing wrong.
>
> > > > I do not remember the answer, but I do know this was discussed on this
> > > > list within the past few months. Search the list forPendingIntentand
> > > > you will probably find it.
>
> > > > --
> > > > Mark Murphy (a Commons Guy)http://commonsware.com
> > > > Warescription: Three Android Books, Plus Updates, $35/Year
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---