Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mime type #135

Open
MustafaDev-shaikh opened this issue Sep 28, 2020 · 1 comment
Open

Mime type #135

MustafaDev-shaikh opened this issue Sep 28, 2020 · 1 comment

Comments

@MustafaDev-shaikh
Copy link

Can we set mime type to allow user to select PDF or image like that.???

@Dipak26
Copy link

Dipak26 commented Mar 1, 2021

Yes you can use that code to support multiple mime types

example for pdf and image files

String[] mimeTypes = {"image/","application/pdf"};
Intent galleryIntent = new Intent(Intent.ACTION_GET_CONTENT, MediaStore.Images.Media.EXTERNAL_CONTENT_URI)
.setType("image/
|application/pdf")
.addCategory(Intent.CATEGORY_OPENABLE)
.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants