Search code examples
androidmedia-player

How to resume the mediaplayer?


I am using a media player.

I have the option for starting ,stopping and pausing the player. The problem I have is that I cannot find the option to resume the song from the point that it previously was paused..

Any help provide would be really helpful.


Solution

  • Thank you for your attention but I've got it myself

    for pausing the Mediaplayer I used:

    Mediaplayer.pause();
    length=Mediaplayer.getCurrentPosition();
    

    and for resuming the player from the position where it stopped lately is done by:

    Mediaplayer.seekTo(length);
    Mediaplayer.start();