I am creating a very simple application for a media player. I would like to resume a song from a SeekTo position that I captured using getCurrentPosition. However, seekTo does not start from the position that I took, but from the very beginning.
Code for fixing the current position, pause and change the button text Press to resume
int media_length = mediaplayer.getCurrentPosition();
Toast.makeText(this,"media length is"+media_length, Toast.LENGTH_LONG).show();
mbutton.setText("Click to Resume");
mediaplayer.pause();
Search code To fix a position, start and change the button text to press the "Pause" button
mediaplayer.seekTo(media_length);
mediaplayer.start();
mbutton.setText("Click to Pause");
A few posts are already related to this, but they seem to be reporting an error in Android. Link: MediaPlayerTo search does not work and is there a workaround for this? appreciate any help.