how to change an imageView when a sound ends with threads
<p>I need to change an ImageView when a sound ends , but when I try to use a thread to use it whitout to freeze the screem the application closes;</p>

<pre><code>mp = MediaPlayer.create(this, R.raw.ave_maria);
    mp.start();
    im = (ImageView) findViewById(R.id.imag1);

    Thread thread = new Thread() {
        public void run() {

            while (mp.isPlaying()) {

            }
            im.setImageResource(R.drawable.primeiro_misterio_gozoso07);
        }
    };
    thread.start();
</code></pre>
