Well, the missing piece is the need to do a call for runOnUIThread.

Basically, I have a service that parses xml into data structures, and
then does a call back to the activity. The activity can do whatever it
wants with the data, but any updates to the UI require(or seem to
require anyway) that they be done inside a Runnable object that gets
passed to runOnUIThread, since only a single thread can do UI updates.

-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Murphy
Sent: Tuesday, June 10, 2008 12:09 PM
To: [email protected]
Subject: [android-beginners] Re: Return result from a service


> The activity could pass a reference to itself in the call to start the
> service, which the service can then call when things change.

Are there examples that demonstrate services calling back into the
activity?

For an activity to call into a service, a lot has to happen: craft the
AIDL, implement the stub in the service, create an IBinder for the
interface, return said binder in the service's onBind(), etc.

I have difficulty believing there's all that work for an activity to
call
a service, but a service calling an activity "just works". At the same
time, I'd like to think there's an AIDL way for an activity to expose an
interface to the service, but it's not obvious how the binders work in
that direction.

I feel like I'm missing a step here. Any pointers?

Thanks!

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ -- Available Now!




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to