I want to detect the stop event of android music player.
I am actually calling a method when the file stops playing.
There is an isPlaying method, but in order to get the stop event, I need to put it inside a while loop which might induce instability?
Is there an elegant way to do this?
This is the code I have:
mp.start(); // mp is the media player object
while (mp.isPlaying() == true) continue;
handler.sendEmptyMessage(0);
Thank you.