简体   繁体   中英

How to acess images and videos from android SD Card and internal storage

I am launching an intent to access only images and videos to use in my Android application using the below intent as follows.

    public static final int IMAGE_PICK = 1;
    Intent intent = new Intent();
    intent.setType("*/*");
    intent.setAction(Intent.ACTION_GET_CONTENT);
    startActivityForResult(Intent.createChooser(intent,"Select Any"), IMAGE_PICK);

Using the above I am able to see the images in IO File Manager and also gallery, apart from this I am also seeing Contacts API. But here I don't want to display Contacts API. Any Suggestions.

Thanks&Regards, Venkat.

  public static final int IMAGE_PICK = 1;
    Intent intent = new Intent();
    intent.setType("image/*");
    intent.setType("video/*");
    intent.setAction(Intent.ACTION_GET_CONTENT);
    startActivityForResult(Intent.createChooser(intent,"Select Any"), IMAGE_PICK);

try this code to open gallery with only images and videos.

Refer this LINK

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM