You don't want to do that. The traditional Java types of synchronization methods don't really work well here because your process can die, and you shouldn't be passing references across activities anyway. Before being too concerned about the overhead of the mechanism you should profile it. Millions of apps do messaging by broadcasts anyway.
For doing this kind of thing, most people use something like an IntentService which accepts its Intent input as the actual "new job" and allows the service to notify the activity of completion via a Messenger/Handler. For jobs that persist across activities you might consider using a broadcast. But most of the time, you could simply save the completed information in a database, and then have a content observer to watch for changes. (You should be serializing as much state as possible in a database anyway, since your application can die at pretty much any point and should be able to restart.. What happens with the low memory killer kills your app when a new job has been issued? You can also serialize jobs in the database in case this happens.) kris On Sat, Jan 19, 2013 at 9:22 PM, dashman <erjdri...@gmail.com> wrote: > I'm concerned about the overhead with this mechanism. > > Also not too sure how to notify the service of a new job. > > If the foreground activity and service share an object - i assume i can > use standard java synchronization - i.e. wait() and notifyall() etc. > > > On Saturday, January 19, 2013 2:03:24 PM UTC-5, TreKing wrote: >> >> On Sat, Jan 19, 2013 at 7:15 AM, dashman <erjd...@gmail.com> wrote: >>> >>> Suggestions? >> >> >> Have your Service send a Broadcast when it's done, then Receive it >> appropriately. >> >> >> ------------------------------------------------------------------------------------------------- >> TreKing - Chicago transit tracking app for Android-powered devices > > -- > 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 -- 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