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

Fix file & image picking with android apps that has launchMode=singleInstance #1380

Closed
wants to merge 11 commits into from

Conversation

melWiss
Copy link

@melWiss melWiss commented Oct 6, 2023

this pr resolves this issue: #1379

@miguelpruivo
Copy link
Owner

Bump the minor version instead of the patch version please.

@melWiss
Copy link
Author

melWiss commented Oct 11, 2023

done

@melWiss
Copy link
Author

melWiss commented Oct 16, 2023

@miguelpruivo can you take a look on this? we need it

Copy link

@rameshniyo rameshniyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine

@melWiss
Copy link
Author

melWiss commented Oct 18, 2023

Thanks buddy

@Musta-Pollo
Copy link

Legit! Thanks a lot 👍 !

Comment on lines -236 to +245
intent = new Intent(Intent.ACTION_GET_CONTENT);
intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this change breaks some older Android versions. For me with this change the file picker doesn't work on Android 9, but reverting this change or setting the intent type depending on Android version (like here) fixes this. I am not sure though which versions should use which intent type and why.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems wrapping all intents with createChooser works with launchMode="singleInstance" regardless of the version of Android even with the old ACTION_GET_CONTENT intent type: example. It will probably work with other launch modes too, but according to the description here it may force the system to show an extra activity chooser dialog if there are several possible activities for choosing a file. So perhaps this wrapping should better be somehow limited only to singleInstance applications.

@melWiss
Copy link
Author

melWiss commented Mar 5, 2024

Hello, sorry I've been away for some period, does this issue still exist?

@rivella50
Copy link

I'd also like to know why this pull request just has been closed?
Is there now a solution for apps which use/have to use launchMode=singleInstance in the Android part?

@sneurlax
Copy link

sneurlax commented Jun 4, 2024

#1336 works for us, so we have been using https://github.com/muttsu-623/flutter_file_picker

But it has issues on Windows, so we had to make https://github.com/cypherstack/flutter_file_picker which is 8.0.3 + muttsu-623's single change: muttsu-623@f0930d9

dan-live365 added a commit to dan-live365/flutter_file_picker that referenced this pull request Jun 26, 2024
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.

7 participants