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

Multiple selection is not available from Samsung Gallery application (Samsung Galaxy Android) #846

Closed
1 task done
innim98 opened this issue Oct 12, 2021 · 5 comments · Fixed by #848
Closed
1 task done
Labels
android Issue applies to Android platform

Comments

@innim98
Copy link
Contributor

innim98 commented Oct 12, 2021

Before creating an issue, make sure that you are on the latest file_picker version and that there aren't already any similar opened inssues. Also, check if it isn't described on the Wiki, specially on Troubleshooting page.

Also, sometimes a simple flutter clean and flutter build again with latest file_picker version, may end up by fixing cached issues, so I encourage you to first do so.

Describe the bug
While picking "Images" from other apps, file_picker uses ACTION_PICK with EXTRA_ALLOW_MULTIPLE parameter to specify multi-selection mode.
It works fine for Google-Photo app, but Samsung Gallery application because Samsung Gallery application ignore EXTRA_ALLOW_MULTIPLE parameter.

  • Samsung Gallery accepts "multi-pick" instead of EXTRA_ALLOW_MULTIPLE.
  • Samsung Gallery returns the list as "selectedItems" array list in bundle extras.

Platform

  • Android
  • [] iOS
  • [] Web
  • [] Desktop (Go)

Platform OS version
Android 11

How are you picking?

Please, post the snippet here

Details to reproduce the issue
Steps to reproduce

  1. Prepare Samsung Galaxy (Android) device. I used Galaxy Note 10+.
  2. build and run "File Picker example app"
  3. Choose "FROM IMAGE" with "Pick multiple files" option, then click "Open file picker"
  4. Choose "Gallery" from the activity chooser
  5. Cannot choose multiple images

Error Log
Please, post the full console log of your issue, if applicable.

Screenshots and/or video
If applicable, add screenshots or video to help explain your problem.

Flutter Version details
[✓] Flutter (Channel stable, 2.2.3, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-AE)
• Flutter version 2.2.3 at /Users/pyungsoohwang/flutter
• Framework revision f4abaa0735 (3 months ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/pyungsoohwang/Library/Android/sdk/
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Users/pyungsoohwang/Library/Android/sdk/
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
• Xcode at /Users/pyungsoohwang/XCode12.4/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] IntelliJ IDEA Community Edition (version 2019.3.3)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.60.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
• SM N770F (mobile) • RF8N31BKZ0L • android-arm64 • Android 11 (API 30)
• macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.7 19H2 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 94.0.4606.71

Additional context
Add any other context about the problem here.

@innim98 innim98 added the new issue An issue that hasn't yet been seen from the maintainer label Oct 12, 2021
@miguelpruivo
Copy link
Owner

This is more or less what happens with some filters, see here.

Basically, there is nothing you can do. What happens is that the Samsung gallery receives those intent actions but is ignoring it, it's up to each app (in this case, each file provider) to properly handle the different intents and their flags. You should protect those cases in your app and be aware that that could happen on Android.

Sorry for any inconvenience.

@innim98
Copy link
Contributor Author

innim98 commented Oct 12, 2021

@miguelpruivo Did I explain in wrong way?
I'm saying file_picker would work fine also for Samsung Gallery app by adding below code.

Adding this when we start chooser activity.
intent.putExtra("multi-pick", this.isMultipleSelection);

Handling result when the onActivityResult() is being called back.
ArrayList<Parcelable> fileUris = bundle.getParcelableArrayList("selectedItems");

Please let me know if you really don't want to fix it.

@miguelpruivo miguelpruivo reopened this Oct 12, 2021
@miguelpruivo
Copy link
Owner

Sorry, I misunderstood your issue. That's because the samsung gallery uses the "multi-pick" flag, probably. Anyhow, could you please provide a PR with it?

@miguelpruivo miguelpruivo added android Issue applies to Android platform and removed new issue An issue that hasn't yet been seen from the maintainer labels Oct 12, 2021
@innim98
Copy link
Contributor Author

innim98 commented Oct 12, 2021

Thank you for your answer, I'll prepare one.

@miguelpruivo
Copy link
Owner

Published with 4.1.4. Thank you @innim98.

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

Successfully merging a pull request may close this issue.

2 participants