question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with pickMultiple for Android

See original GitHub issue

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
     });

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
frist008commented, Jun 17, 2020

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;
				}
0reactions
zaheerahmad92001commented, Jan 4, 2021

me too same problem . only one file is selected

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Issue with pickMultiple for Android - - Bountysource
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...
Read more >
DocumentPicker in React-Native not working properly for ...
I have implemented a document picker in my react native application and it is working fine for iOS. However in Android ...
Read more >
react-native-document-picker - npm
Issue tracker is now reserved for bugs and feature requests only and ... Use pickMultiple , pickSingle or pick to open a document...
Read more >
Picking files in React Native apps using ... - LogRocket Blog
Learn how to pick documents and files of any format from a user's device in a React Native application for iOS and Android....
Read more >
Intent - Android Developers
... with a UI where they can pick multiple items that are all returned to the caller. ... "product" represents that the topic...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found