How can I display the video in same view of ListView
when I click the item of ListView
like the image below?
Asked
Active
Viewed 910 times
-1

Phantômaxx
- 37,901
- 21
- 84
- 115

Ajay
- 185
- 3
- 18
-
1So you want to create a `ListView` where all the items are videos or..? – Catalina Apr 20 '15 at 16:04
-
Displaying images in the listview,when i click on image that will be hide and shows the video at the same view.And also when i scroll the listview the video will not be stop. – Ajay Apr 21 '15 at 04:17
-
Do you have a list of URLs for the videos and/or a list of image thumbnails? – Catalina Apr 21 '15 at 08:35
-
yes i have list of video urls and images – Ajay Apr 21 '15 at 11:32
2 Answers
0
On the ListView
with the images you can add a setOnItemClickListener
Then when onItemClick
is called you can retrieve the URL of the video you are trying to play according to the position in the list like this
String videoUrl = videoUrls[position];
From here you can open a new Activity
/Dialog
; whichever you prefer to display the video and add the URL as an argument using something similar to this:
Bundle args = new Bundle();
args.putString("URL", videoUrl );
Then assign it using setArguments(args)
to your Dialog
if you have chosen a Dialog
or using putExtra
if you have chosen an Activity
.
From here you can get the video URL and display it.

Catalina
- 1,954
- 1
- 17
- 25
-1
Short answer: Fragments
on listitem click switch the listview to your player fragment.

BooNonMooN
- 250
- 3
- 13