I think all you have to do is call videoView.setVideoPath(next_file_path)
and then call videoView.start()
. If the video is no longer there, call videoView.stopPlayback()
.
Something might work here:
@Override public void onClick(DialogInterface dialog, int which) { if (arg1 == 0) { Intent intentInfo = new Intent(ListViewActivity.this, DialogBox.class); // Retrieve the path names of all videos from the top to the // selected item (inclusive). arrayPath = new String[selectedPosition+1]; for (int i = 0; i <= selectedPosition; ++i) { arrayPath[i] = videoItems.get(i).absolutePath; } VideoInfo info = videoItems.get(selectedPosition); intentInfo.putExtra("fileName", info.name); intentInfo.putExtra("fileSize", info.size); intentInfo.putExtra("absolutePath", info.absolutePath); intentInfo.putExtra("arrayPath", arrayPath); startActivity(intentInfo); } else { deleteFile(); } }
This passes an array of path names to your DialogBox activity (which you haven't posted yet). You can then get the arrayPath
and pass it to the VideoView action if the user chooses to play all the videos.
source share