On Mon, Nov 1, 2010 at 9:29 PM, Bret Foreman <bret.fore...@gmail.com> wrote:
> 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 the "set of background threads" are from the activity, just talk to
the activity (e.g., onPostExecute() in AsyncTask).

If the "set of background threads" are in a Service, use
createPendingResult() in Activity to create a PendingIntent that will
route to the activity's onActivityResult() and pass that PendingIntent
to the service. Or, if you are using the local binding pattern, pass a
callback object from the activity to the service. Or, use a
ResultReceiver.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://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