onDestroy() method doesn't work
<p>first I used onDestroy() method as below to make something when my app is closed.</p>

<pre><code>@Override
protected void onDestroy()
{
    super.onDestroy();
    mediaPlayer.stop();
    mediaPlayer2.stop();
}
</code></pre>

<p>But it causes a runtime error. I used onStop() method instead and problem was solved. But I wonder why onDestroy doesn't work? Can you explain please.</p>

<pre><code>@Override
protected void onStop()
{
    super.onStop();
    mediaPlayer.stop();
    mediaPlayer2.stop();
}
</code></pre>

<blockquote>
  <p>I was made some changes on my code and now there is no error when I
  changed onStop() with onDestroy() I can't understand how but it works.</p>
</blockquote>
