title: How do you detect when a sound file has finished?
body: <p>I am playing a sound file using this code inside a broadcast receiver activity:</p>
  
  <pre><code>notification.sound = Uri.parse("android.resource://emad.app/raw/seven_chimes");
  </code></pre>
  
  <p>I would like to detect when this file has finished playing.</p>
  
  <p>I tried a loop like this but I think this is only good for the media player because it always = false even though I made sure the sound file was still playing:</p>
  
  <pre><code>/*
   * Stay here until the chime sound is finished.
   */
     while (manager.isMusicActive()){
     }
  </code></pre>
  
  <p>Can you show me what I should use instead of <code>manager.isMusicActive()</code>?</p>