How to dismiss progressdialog if mp3 is already playing in android
<p>My question is how do you dismiss the ProgressDialog if mp3 is already playing?</p>

<p>Please check what I have tried so far:</p>

<pre><code>mediaPlayer.setDataSource(timelessFuture);
mediaPlayer.prepare(); 

// gets the song length in milliseconds from URL
mediaFileLengthInMilliseconds = mediaPlayer.getDuration(); 
progressDialog = ProgressDialog.show(this, "Downloading", "Please wait while podcast is being downloaded...");

if(!mediaPlayer.isPlaying()){
    mediaPlayer.start();
    play.setCompoundDrawablesWithIntrinsicBounds(R.drawable.button_pause, 0, 0, 0);
}   else {
    mediaPlayer.pause();
    play.setCompoundDrawablesWithIntrinsicBounds(R.drawable.button_play, 0, 0, 0);
}

primarySeekBarProgressUpdater();
</code></pre>

<p>What am I missing in here?</p>
