I am trying to pick a file with any of these 3 mime types, and it doesn't seem to work
Intent photoPickerIntent = new Intent(Intent.ACTION_GET_CONTENT);
photoPickerIntent.setType("image/*, video/*, audio/*");
Can someone suggest how I can do it ?
Write below code instead of your code, it may help you.
private static final int PICTURE = 0;
private static final int VIDEO = 1;
private static final int AUDIO = 2;
Intent photoPickerIntent = new Intent(Intent.ACTION_GET_CONTENT);
String title = GET_PICTURE;
if (this.mediaType == PICTURE) {
photoPickerIntent.setType("image/*");
title = "GET_PICTURE";
}else if (this.mediaType == VIDEO) {
photoPickerIntent.setType("video/*");
title = "GET_VIDEO";
}else if (this.mediaType == AUDIO) {
photoPickerIntent.setType("audio/*");
title = "GET_AUDIO";
}
And Use below links for reference.
Pick Intent Example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With