Also for most people just writing their own service for use with their own
app, the service and activity are always running in the same process, so you
can just use the LocalService API demo and get a direct pointer to the
service object and call back and forth between them however you want.

On Mon, Nov 24, 2008 at 8:42 AM, Jeff Smith <[EMAIL PROTECTED]>wrote:

>
> Have you looked at RemoteService.java and RemoteServiceBinding.java in the
> APIDemos project that comes as a sample with the SDK? I believe these are
> using remote callbacks to achieve the result it seems you are looking for.
>
>
> -----Original Message-----
> From: [email protected] [mailto:
> [EMAIL PROTECTED] On Behalf Of G
> Sent: Monday, November 24, 2008 9:50 AM
> To: Android Developers
> Subject: [android-developers] Sending a message from Service to Activity
>
>
> After a long working weekend I finally have a grasp on how activities
> bind to services (as well as how services outlive the activities that
> started them). But it seems that through binding, the communication is
> only 1-way (Activity -> Service). How can my service notify my
> activity of something? Do I need to define a BroadcastReceiver and
> sendBroadcast() from my service or is there an easier way to do it
> while the Service and Activity are binded?
>
> (This is a Remote Service btw, and if you're going to tell me to use a
> Handler, please please please include a link to a tutorial or some
> good sample code, cause I can't seem to find any)
>
> Thanks in advance :)
>
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
[EMAIL PROTECTED]

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

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