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

Issue with pickMultiple for Android #317

Closed
NixSolutionsMobile opened this issue Jun 16, 2020 · 5 comments · Fixed by #386
Closed

Issue with pickMultiple for Android #317

NixSolutionsMobile opened this issue Jun 16, 2020 · 5 comments · Fixed by #386

Comments

@NixSolutionsMobile
Copy link

I'm using pickMultiple method for selecting files from iOS and Android. For iOS it's working properly and nice.
But for Android library is working very strange. In native Intent I can select several files but in final I get only first selected files.

Here example of my code:

DocumentPicker.pickMultiple({
      type: [
        DocumentPicker.types.allFiles,
        DocumentPicker.types.images,
        DocumentPicker.types.video,
        DocumentPicker.types.audio,
        DocumentPicker.types.pdf,
      ],
    })
      .then((result) => {
// In result always only 1 file when I selected more that 1
     });
@frist008
Copy link

I think it is necessary to swap the condition.

Example:

				if (clipData != null && clipData.getItemCount() > 0) {
					final int length = clipData.getItemCount();
					for (int i = 0; i < length; ++i) {
						ClipData.Item item = clipData.getItemAt(i);
						results.pushMap(getMetadata(item.getUri()));
					}
				} else if (uri != null) {
					results.pushMap(getMetadata(uri));
				} else {
					promise.reject(E_INVALID_DATA_RETURNED, "Invalid data returned by intent");
					return;
				}

@miketrinh1995
Copy link

miketrinh1995 commented Jun 26, 2020

I have the same issue. If i pick multiple files. App Files keeps stoping (Files app of Samsung).
So, i have to pick file by file to avoid crash app File
Note: I'm using Samsung devices (S10, S7)
Log bug :
2020-06-29 11:22:40.725 10124-10124/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.android.documentsui, PID: 10124
java.lang.NullPointerException: mimeTypes is null

@miketrinh1995
Copy link

I'm using pickMultiple method for selecting files from iOS and Android. For iOS it's working properly and nice.
But for Android library is working very strange. In native Intent I can select several files but in final I get only first selected files.

Here example of my code:

DocumentPicker.pickMultiple({
      type: [
        DocumentPicker.types.allFiles,
        DocumentPicker.types.images,
        DocumentPicker.types.video,
        DocumentPicker.types.audio,
        DocumentPicker.types.pdf,
      ],
    })
      .then((result) => {
// In result always only 1 file when I selected more that 1
     });

I fixed with type [
DocumentPicker.types.allFiles,
]

@mskarimi
Copy link

mskarimi commented Nov 4, 2020

I'm using pickMultiple method for selecting files from iOS and Android. For iOS it's working properly and nice.
But for Android library is working very strange. In native Intent I can select several files but in final I get only first selected files.

Here example of my code:

DocumentPicker.pickMultiple({
      type: [
        DocumentPicker.types.allFiles,
        DocumentPicker.types.images,
        DocumentPicker.types.video,
        DocumentPicker.types.audio,
        DocumentPicker.types.pdf,
      ],
    })
      .then((result) => {
// In result always only 1 file when I selected more that 1
     });

me too
same problem

@zaheerahmad92001
Copy link

me too
same problem . only one file is selected

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 a pull request may close this issue.

5 participants