title: Call onDestroy() of Service
body: <p>I want to call </p>
  
  <blockquote>
    <p>onDestroy()</p>
  </blockquote>
  
  <p>method of Service in android.</p>
  
  <p>I already searched a lot on internet and many answers are like if </p>
  
  <p><strong>service force stop or somehow its onDestroy() will never call.</strong></p>
  
  <p>But I really need to know when service is stop.</p>
  
  <p><strong>My project is about music player.</strong> </p>
  
  <p>So it uses service and there is an ongoing notification.
  I need to find out when the service stop? and need to stop the music and remove the notification.</p>
  
  <p>But it never shows any log of <code>onDestroy()</code>.
  Can anyone help me what is the alternative for it? if not <code>onDestroy()</code> then which method and how?</p>
  
  <p>Edit:</p>
  
  <p>I don't want to call <code>onDestroy()</code> explicitly. I want to remove notification when I remove my app from the device menu of running applications. Because when I stop my application, <code>onDestroy()</code> don't call and my notification remains in the status bar.</p>
  
  <p>I have started my service with this code.</p>
  
  <pre class="lang-java prettyprint-override"><code>Intent playin = new Intent(this, MusicService.class);
  startService(playin);
  </code></pre>