I have an application that opens different videos using the Intent selection. Thus, you can imagine that the user clicks on a list item that contains many items with the name of the video.
Now everything works fine with this,
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uriPath, "video/mp4");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
but when the user clicks on the same item again, a choice of intent is displayed. Selecting a video player on the device resumes the video.
So the question is, is there any flag or some way in which the video can be started from the very beginning?
This thing happens not only with video, but also with pdf. If the PDF was opened and scrolls to the last page, then again opening the PDF from my application opens it with the last page.
source
share