Hi guys Im trying to stop mediaplayer in certain point but it doesnt work for me below is my code let me know what is wrong in this code.
int Str = 36000;
int Stop = 51000;
mediaPlayer.seekTo(Str);
mediaPlayer.start();
if(mediaPlayer.getCurrentPosition() == Stop)
{
mediaPlayer.stop();
}
Media player starts at the specified point and it continues to play, when I debug it, it comes to the if condition and it still continues to play no error(as far I know) is displayed, I played with while, if condition and debug line by line but cant figure out,Please help me Thanks for your time
Try to bound the time:
However, use this wisely, you might freeze something and end up in ANR.
You mind find useful using
ThreadorHandlerdelaying for 1000ms, but as @dhaag23 mentioned, its unlikely to get exactStop