title: How to stop Android service when app is closed
body: <p>I'm trying to keep service running continously until user close app.</p>
  
  <p>I'm using <code>startService()</code> method from <code>onCreate()</code> method of my main activity and <code>stopService()</code> in <code>onDestroy()</code> method.</p>
  
  <p>Now I have problem, because it seems that my main activity dies and is re-created when I rotate device or when I turn off screen.</p>
  
  <p>How can I stop my service only when user stops app manually?</p>