Well, I ran a few experiments and haven't yet found a way to make this
work. The problem is that I have a set of background threads that are
updating various rows in an SQLite database. I also have a UI thread
that needs to know about those updates so the widgets can be updated.
I believe broadcast intents are the way to do this but I can't find a
way to distinguish them to make sure none are eliminated as
duplicates. If I change the fingerprint of the intent then it no
longer matches at the receiver. If I leave the fingerprint the same
then some of the intents get swallowed as duplicates.

In practice these intents are not duplicates at all since they contain
a message about which database rows have been updated. But that
message necessarily goes in the Extras where it can't do any good to
prevent intents from being dropped.

Maybe I need another approach. Is there another mechanism that will
_always_ deliver messages just as they were sent?

On Oct 30, 12:18 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> On Sat, Oct 30, 2010 at 3:14 PM,Bret Foreman<bret.fore...@gmail.com> wrote:
> > I have an IntentService that broadcasts an Intent each time if
> > finishes some work. Each broadcast Intent is identical except that it
> > contains a Bundle with some result information from the IntentService.
> > Evidently, having different data in the Bundle is not enough for
> > Android to think it's a different Intent.
>
> Correct.
>
> > If the IntentService
> > broadcasts two of these Intents back-to-back, the second one is
> > dropped as a duplicate.
>
> > I know I've read about this behavior in this forum in the past but I
> > can't find in the documentation where this duplicate elimination logic
> > is described in detail. Mostly, I just want to differentiate the
> > Intents enough that they are not considered duplicates. Any pointers
> > would be appreciated.
>
> I believe that Android uses filterEquals() on Intent to determine if
> two Intents are equivalent for this purpose. From the documentation:
>
> "Determine if two intents are the same for the purposes of intent
> resolution (filtering). That is, if their action, data, type, class,
> and categories are the same. This does not compare any extra data
> included in the intents."
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android 2.2 Programming Books:http://commonsware.com/books

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to