Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to find if the song is ended in android

Tags:

android

i use MediaPlayer in android and i am playing a song by start method and i have to find if the song is ended not paused or stop. . please help me.

like image 555
M.A.Murali Avatar asked Jan 20 '23 20:01

M.A.Murali


1 Answers

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
}
like image 195
Chirag Avatar answered Feb 01 '23 16:02

Chirag