-
Notifications
You must be signed in to change notification settings - Fork 425
fix(dialog): remove use of ACTION_PICK #2871
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
Conversation
Package Changes Through 42f62f9There are 2 changes which include dialog with patch, dialog-js with patch Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
successfully tested by community #2423 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like Android got tons of different APIs for doing this, from ACTION_GET_CONTENT
's docs, it seems like we should almost always prefer it over ACTION_PICK
Note: didn't test
// TODO: ACTION_OPEN_DOCUMENT ?? | ||
val intent = Intent(Intent.ACTION_GET_CONTENT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the docs I read about were using ACTION_OPEN_DOCUMENT
, and https://developer.android.com/guide/components/intents-common#GetFile seems to suggest that EXTRA_MIME_TYPES
is not available for ACTION_GET_CONTENT
, but from testing it does work
And seems like if I use ACTION_OPEN_DOCUMENT
, I'll be limited to just the files, but with ACTION_GET_CONTENT
I can pick files from other apps (so I would probably prefer ACTION_GET_CONTENT
as the one you're currently using)

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc (already forget 4 days later) other similar frameworks use open_document instead as well. One thing that seems like a major advantage of open_document is that is opens them in-place without copying them into your app cache or whatever. so i guess offering it as an option (after more investigation) sounds valuable to me.
And seems like if I use ACTION_OPEN_DOCUMENT, I'll be limited to just the files
not sure what you mean
it seems like we should almost always prefer it over ACTION_PICK
yep, action_pick only makes sense if we already have a list of data/files which i can't really think of a usecase for here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah got it. i guess that makes sense though with how it opens files without copying them. hard to do if the file may be in the cloud.
fixes #2423
fixes #2826
closes #2866
from a bit of googling around it seems like there's no reason to use ACTION_PICK like ever. Replacing it with what we use when no filters are set was enough to fix the issue. From quite a bit of testing there also seems no reason for that
setIntentMimeTypes
function to exist. I did not see any difference in behavior so i'd prefer to remove it.And yes, setting / even if you set a single filter is totally fine.