On Thu, Aug 19, 2010 at 7:40 AM, Sebastián Treu
<[email protected]> wrote:
> Hi Mark,
>
> Thanks for explaining how they are compared.
>
> On Thu, Aug 19, 2010 at 7:28 AM, Mark Murphy <[email protected]> wrote:
>> On Thu, Aug 19, 2010 at 6:23 AM, Sebastián Treu
>> <[email protected]> wrote:
>>> What does it mean: "[...] if the described PendingIntent already
>>> exists [...]" ?
>>
>> Pretty much exactly what it says. PendingIntents are compared by
>> comparing their Intents. Intents are compared via filterEquals().
>> filterEquals() looks at component, action, MIME type, and category, to
>> see if the Intents are equivalent.
>
> But, where does they live? I mean, it the PendingIntent created with a
> Factory and when getBroadcast() is called you get a reference to it?.
> Then, if you call getBroadcast() again, will it take the intent you
> specify as an argument, look at every PendingIntent it has allocated
> and compared the way you explain? Does the framework maintain a list
> of allocated PendingIntent objects? That will clarify the concept to
> me lot.


I manage to reach the source code, this is what getBroadcast() does:


IIntentSender target = ActivityManagerNative.getDefault().getIntentSender(
      IActivityManager.INTENT_SENDER_BROADCAST,
      packageName,
      null,
      null,
      requestCode,
      intent,
      resolvedType,
      flags
      );
return target != null ? new PendingIntent(target) : null;

I read also the code within ActivityManager. That will be a new
reference every time is invoked. Objects could be differents
references but the IntentSender could be the same if I understood the
code correctly.


I was wrong on the references.

Cheers,
-- 
If you want freedom, compile the source.

Sebastián Treu
http://labombiya.com.ar

-- 
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

Reply via email to