How-to kill my app without killing the service it sarted (debugging)
<p>My android application starts a service when runned for the first time. That service handles network connection.</p>

<p>If the device is out of free space, my application can be killed, but the service will remain alive (except on certain extreme case, I know.). When the app will be restarted, it will need to restore it state according to the service state (no problem for that).</p>

<p>Here's my question: How can I kill my application, but not the associated service ? That's only for debugging purpose, I would like to test if the state is correctly restored.</p>

<p>When I try to kill the app with adb, ddms or advanced task killer, the service is killed too.</p>

<p>Any ideas ?</p>

<p>Thanks,</p>

<p>Code: I start my service like that:</p>

<pre><code>final Intent intent = new Intent(this, Service.class);
mStartServiceResult = startService(intent);
mIsBound = bindService(intent, mConnection, 0);
</code></pre>

<p>and use startForeground / setForeground to prevent my service to be killed.</p>
