title: How to implement a "watchdog" service
body: <p>I'm trying to implement a service relationship that roughly looks like this:</p>
  
  <pre><code>{ACTIVITY} -&gt; {SERVICE1} -&gt; {SERVICE2}
  </code></pre>
  
  <p>The ACTIVITY starts SERVICE1 which then starts SERVICE2. It is very very important that SERVICE2 can shut itself down. If SERVICE1 crashes, SERVICE2 should have a chance to shut itself down cleanly. I've already achieved that using a remote process for SERVICE2 so if SERVICE1 crashes it can shut itself down. </p>
  
  <p>The tricky part is if the user does a Force Close through the application manager. </p>
  
  <p>I understand that no solution is 100%. BUT! I've noticed that the Yahoo Weather app is able to run something they're calling a "Watchdog" in a completely separate app line. Killing the main Yahoo weather app doesn't kill the Watchdog app. WHAT VOODOO IS THIS? And how can I replicate something similar?</p>
  
  <p>Images of the yahoo app:</p>
  
  <p><a href="https://dl.dropboxusercontent.com/u/2193687/device-2014-05-22-151216.png" rel="nofollow">https://dl.dropboxusercontent.com/u/2193687/device-2014-05-22-151216.png</a>
  <a href="https://dl.dropboxusercontent.com/u/2193687/device-2014-05-22-151236.png" rel="nofollow">https://dl.dropboxusercontent.com/u/2193687/device-2014-05-22-151236.png</a></p>