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

Hw to use library for multiple files selected from media library? #156

Open
silkograph opened this issue Dec 16, 2021 · 0 comments
Open

Comments

@silkograph
Copy link

I need to select multiple files from library and loop through each file and process it.
So far I enabled multiple file select option as follows
In openMediaContent method
startActivityForResult(intent, ScanConstants.PICKFILE_REQUEST_CODE);

and then in onActivityResult based on selection I added following for loop

else {
            ClipData clipData = data.getClipData();
            if (clipData != null) {
            for (int i =0; i< clipData.getItemCount(); i++) {
                Uri imageUrl = clipData.getItemAt(i).getUri();
                try {
                    InputStream is = getActivity().getContentResolver().openInputStream(imageUrl);
                    bitmap = BitmapFactory.decodeStream(is);
                    postImagePick(bitmap);
                } catch (FileNotFoundException e) {
                    e.printStackTrace();
                }
               }
            }
          ....

I am not getting error but it process only one file instead of all files.

How should I process all files if I select multiple files using this library.

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

No branches or pull requests

1 participant