2

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?

Markus Kauppinen
  • 3,025
  • 4
  • 20
  • 30
CodingInPyjama
  • 85
  • 1
  • 2
  • 8
  • 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 Answers2

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);
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);