On Fri, Aug 17, 2012 at 5:24 PM, Ubuntu guy <[email protected]> wrote:
> Sorry, i should have given process info.
> Both of my services run in independent applications and they are in
> different process to reduce point of failures (like abnormal process
> termination, low memory kills etc).
>
>    This use case is when Service A (process A) is destroyed, it stops
> Service B (process B) and waits for an ack back in its onDestroy().

Oh, OK. I'm not a huge fan of this particular dual-service model, but
that's irrelevant here.

If Service A is blocking its main application thread, it cannot
receive a broadcast, since that too would be on the main application
thread. Either you will need to:

- get rid the ack, or

- switch to a synchronous communications model (e.g., AIDL-based bound
service) and hope that works from a destroyed service, or

- stop Service B somewhere before onDestroy() of Service A, and shut
down Service A when the ack broadcast is received

Personally, I prefer the latter option.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 4.0 Available!

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