I want to be able to pick only videos from gallery but I only found tutorials that select images but I only want to be able to select videos. Can anyone help?
Asked
Active
Viewed 1,586 times
2
-
Possible duplicate of [How to select a video from the gallery and get it's real path?](https://stackoverflow.com/questions/31044591/how-to-select-a-video-from-the-gallery-and-get-its-real-path) – Vikasdeep Singh Aug 17 '18 at 14:29
2 Answers
2
For example, when you use an intent, you can set the type of your intent. Here I'm using "video/*"
to get all videos of my device.
Intent galleryIntent = new Intent(Intent.ACTION_PICK);
galleryIntent.setType("video/*");
startActivity(galleryIntent);

Geoffrey D.
- 48
- 5
1
Try this code..
protected int REQUEST_TAKE_GALLERY_VIDEO = 3;
Intent intent = new Intent();
intent.setType("video/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select Video"),REQUEST_TAKE_GALLERY_VIDEO);