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

ACTION_GET_CONTENT with multiple MIME types #402

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

moffatman
Copy link

@moffatman moffatman commented Feb 8, 2025

Some apps provide multiple MIME types separated by either comma or pipe.

Without this, image/*,video/* only shows images.

Fixes #403

What is it?

  • Bugfix
  • Feature
  • Codebase improvement

Description of the changes in your PR

  • Parse ACTION_GET_CONTENT compound type
  • Handle case of mIsGetImageContentIntent && mIsGetVideoContentIntent

Acknowledgement

Some apps provide multiple mime types separated by either comma or pipe.

Without this, image/*,video/* only shows videos.
@naveensingh
Copy link
Member

Before fixing a bug or adding a new feature, ensure it’s already reported or requested in the repository, open, and doesn’t have the needs triage label. If the issue is closed or has needs triage label, your PR will likely be rejected. The only exceptions are critical bugs that we weren't able to classify yet.

Thanks for the PR! You should create an issue first as stated in the contribution guidelines.

Some apps provide multiple MIME types separated by either comma or pipe.

Can you name some apps that actually do this?

@naveensingh naveensingh self-assigned this Feb 8, 2025
@naveensingh naveensingh added the waiting for author If the author does not respond, the issue will be closed. Otherwise, the label will be removed. label Feb 8, 2025
@moffatman
Copy link
Author

I created #403. I am opening this PR since a user of my app (https://github.com/moffatman/chan) complained about the media picker only showing images.

I use the Flutter file_picker plugin which offers a "media" filetype which turns into the "image/,video/" MIME.

You can see this technique is used in other places too

https://github.com/search?q=%22image%2F*%2Cvideo%2F*%22+language%3Ajava&type=code

@naveensingh naveensingh removed the waiting for author If the author does not respond, the issue will be closed. Otherwise, the label will be removed. label Feb 10, 2025
@naveensingh
Copy link
Member

Thanks!

Flutter file_picker plugin

I'm curious, is there no way to supply the types in a standard way like one can do with Intent.EXTRA_MIME_TYPES?

@moffatman
Copy link
Author

In my opinion there are way too many intents and ways to do this on Android. ACTION_GET_CONTENT, ACTION_OPEN_DOCUMENT, ACTION_OPEN_DOCUMENT_TREE of parent dir, ACTION_PICK. This way I've found works quite well with the exception of your gallery app. Maybe EXTRA_MIME_TYPES could work everywhere too. But your app doesn't implement it either. So I prefer to leave it this way....

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

Successfully merging this pull request may close these issues.

When used as a picker, image/*,video/* intent only shows images
2 participants