I have a videoplayer application. Suppose the user has played a video and after playing half of the video, the user pressed the back button or exists the application. I want that position to be remembered so that the next time, the user plays the same video, the video starts from exactly the same position from where it was left.
Any ideas in this regard?
Thanks much
First, you will need to store this data in some database, but it’s quite simple.
Now, you should add a check in the
onPause()oronDestroy()method of your activity, which gets the position from the videoview:When you play a video, set the current position as stored before: