Re: [android-developers] Re: Working With Multiple Widget Sizes

2011/4/2 Jake Colman <colman@ppllc.com>
Kostya,

Thanks for the detailed reply.

For those events that are shared by the two receivers, what happens if
only one sized widget is actually on the home screen?  The system sends
the event and it is still processed by "unused" broadcast receiver even
though its widget is not instantiated?  That's the behavior I am seeing
and it sounds like you see the same.
 
For anything other than onUpdate -  widgets are built on top of the broadcast receiver mechanism, they make use of how receivers work, but don't change that.
 
That mechanism doesn't know that there are no widgets of a particular size on the screen, it just sends those events to all receivers that have matching intent filters. It doesn't even know (I think) that those receivers are actually widgets. The home screen app does, but not the intent dispatcher.
 
If there are 1337 of those, then all will be invoked. I think it's a safe guess that with 1338 it works the same way :)
 

With regard to your statement "Multiple broadcasts haven't been a
problem with my setup, because my code double checks widget Ids against
my own known widget Id list for that particular widget size", you still
get the multiple broadcasts but you are smart enough to ignore them?
 
Yes. I have to track widget Ids on my own, because there is a fairly well known problem with "stale" ("ghost") widget Ids.
 
I posted this before, here is my setup:
 
 
 -- Kostya
 

--
Jake Colman -- Android Tinkerer

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en