title: Android service stops when app is stopped
body: <p>From the <code>onStartCommand</code> in my service I spawn a thread that begins a very long download process. The problem is that when the user closes the app through the multitasking screen (and they do sometimes), the download thread stops running too.</p>
  
  <p>A while after it stops, the service's <code>onCreate</code> is being called again if I return START_NOT_STICKY in <code>onStartCommand</code>, and is also restarted with a null intent if I return START_STICKY in <code>onStartCommand</code>.</p>
  
  <p>I figured that if I return <code>START_CONTINUATION_MASK</code> in <code>onStartCommand</code> the download thread won't stop when the app is closed through the multitasking screen. But I don't feel like I can trust this flag because I can't find any recommendation to use it.</p>
  
  <p>I don't need to ensure my service will run forever with startForeground, I just need it to keep running after the app is closed at least in most cases (as long as the OS isn't in extreme memory conditions).</p>
  
  <p>What should I do?</p>