How to Create Android Video Player: 2. Playing Video from List

This part covers, how to create video screen and how we can play selected video from list.
How to Create Android Video Player

Topics Covered

Selecting Video to Play

In the previous part, you can see, how to populate video list. To play selected video, apply onItemClickListener() on ListView. See below code.

And pass the complete path of the selected video to Video Activity using Intent.

Creating Video Activity

Create new Activity named “” and set content view as videoplayer layout. Now get the filename/path of Video from Intent object passed from VideoListActivity. See code below.

Here is the layout xml of the VideoPlayer.

And add the activity node into AndroidManifest.xml for VideoPlayer Activity.

Run the project and test it.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *