i use MediaPlayer in android and i am playing a song by start method and i have to find if the son开发者_C百科g is ended not paused or stop. . please help me.
Please implement onCompletion Listener .
mediaPlayer.setOnCompletionListener(this);
When song is ended then media player automatically called onCompletion method.
public void onCompletion(MediaPlayer arg0)
{
// Write your code
}
You have to register OnCompletionListener using setOnCompletionListener method. When the song is played endCompletion will be called.
精彩评论