I'm registering a callback object when my service is connected. That callback object contains function(s) pointers that return back to my Activity when something interesting happens in a Service.
Seems to work well for me. On Jan 29, 3:23 pm, Dianne Hackborn <[email protected]> wrote: > On Thu, Jan 29, 2009 at 3:07 PM, Noonien Soong > <[email protected]>wrote: > > > "...and give it to the service." - How do I "give it to the > > service?". > > with intent.putExtra ? Since PendingIntent is a Parcelable? > > Yes the normal ways you would talk with a service -- you can put it in the > Intent if you are starting it, or you can pass it through a call in its > interface if you are binding. > > > > (4) Easiest way: if your service and activity is running in the same > > process > > > (I would expect this to be the common case), then follow the local > > service > > > API demo where you can just directly call each other. Or have a global > > > pointing to your activity while it is running that the service looks at, > > > etc. > > A global ? As in "a global variable in the Application object?" I > > somehow felt that was bad practice. > > It's a convenient short-cut. If you are philosophically opposed to such > things you can go the more formal route and make things harder on yourself. > :) > > -- > 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 -~----------~----~----~----~------~----~------~--~---

