Actually, the official example in the same process doesn't use binders for
communication at all:

http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/app/LocalServiceBinding.html
http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/app/LocalService.html

I don't know what we've done to lead so many people to jump to the much more
complicated remote service sample, but if your service and activity are in
the same process then I strongly recommend taking advantage of that like the
local example does.

On Sat, Aug 29, 2009 at 9:04 AM, Rafael Martins <[email protected]>wrote:

>
> Hi, folks!
>
> I'm searching for the simplest way to implement a communication
> between an activity and a service when both are running at the same
> process.
>
> I've already made it using binders like the official example in the
> API Demo, but I want to call activity's methods from the service. So,
> I've made a public static method in the activity and it is working. I
> would like to understand the problems of doing this. Why we have to
> use binders if we can do all without them? How is the simplest way to
> do this?
>
> Sorry if this is a silly question... :-)
>
> Thank u all!
>
> >
>


-- 
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, and so won't reply to such e-mails.  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