Android-FilePicker icon indicating copy to clipboard operation
Android-FilePicker copied to clipboard

Not working for android 10 documents

Open br-neeraj opened this issue 4 years ago • 13 comments

working fine on below 10 devices but on android 10 only images and videos are showing.

br-neeraj avatar Apr 24 '20 04:04 br-neeraj

document not selectable in Android 10 it's Only show images & Video can you please Fix it..?

NiravPotenza avatar May 06 '20 12:05 NiravPotenza

same bug

andresbelt avatar May 09 '20 17:05 andresbelt

I am able to see files in emulator. Can you list what configuration are you using?

DroidNinja avatar May 14 '20 17:05 DroidNinja

Android 10 API 29, samsung A 50, same for galaxy s10 emulator by genymotion

andresbelt avatar May 15 '20 00:05 andresbelt

I am able to see files in emulator. Can you list what configuration are you using?

i cant understand what configuration are you talking about. i am using Asus zenfone 6, 5z, galaxy s10 and redmi note 8 pro all device have android 10 and all device doesn't support docs.

br-neeraj avatar May 16 '20 11:05 br-neeraj

I am talking about Filepicker configuration you are using for querying filetypes?

DroidNinja avatar May 16 '20 11:05 DroidNinja

well, I'm using your unmodified demo

public void onPickDoc() { String[] zips = {"zip", "rar"}; String[] pdfs = {"pdf"}; int maxCount = MAX_ATTACHMENT_COUNT - photoPaths.size(); if ((docPaths.size() + photoPaths.size()) == MAX_ATTACHMENT_COUNT) { Toast.makeText(this, "Cannot select more than " + MAX_ATTACHMENT_COUNT + " items", Toast.LENGTH_SHORT).show(); } else { FilePickerBuilder.getInstance() .setMaxCount(maxCount) .setSelectedFiles(docPaths) .setActivityTheme(R.style.FilePickerTheme) .setActivityTitle("Please select doc") .addFileSupport("ZIP", zips) .addFileSupport("PDF", pdfs, R.drawable.pdf_blue) .enableDocSupport(true) .enableSelectAll(true) .sortDocumentsBy(SortingTypes.name) .withOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) .pickFile(this); } }

with the last commit, does not work

andresbelt avatar May 16 '20 17:05 andresbelt

I tried on a real device and observed that MediaStore don't list all types of files in Android 10 (just the media files). You'll need to enable android:requestLegacyExternalStorage="true" for showing files on android 10 device. This document picker will get deprecated soon over scoped storage and also, this flag will not work in Android 11. :/

DroidNinja avatar May 16 '20 20:05 DroidNinja

it works well now on Android 10

andresbelt avatar May 17 '20 02:05 andresbelt

I tried on a real device and observed that MediaStore don't list all types of files in Android 10 (just the media files). You'll need to enable android:requestLegacyExternalStorage="true" for showing files on android 10 device. This document picker will get deprecated soon over scoped storage and also, this flag will not work in Android 11. :/

Do you have any permanent solution ? or we need to find ourselves. By d way you already did a great help

br-neeraj avatar May 17 '20 05:05 br-neeraj

@br-neeraj I dont think there are any more hacks to it for showing on Android 10 or above devices. I tried almost everything. There is no app that is being able to list files without this flag. and by Android 11, they will have to switch to OS file picker too. You will not to able to filter like this. However, If you find something..please raise PR ...will be happy to merge it.

DroidNinja avatar May 17 '20 05:05 DroidNinja

@br-neeraj I dont think there are any more hacks to it for showing on Android 10 or above devices. I tried almost everything. There is no app that is being able to list files without this flag. and by Android 11, they will have to switch to OS file picker too. You will not to able to filter like this. However, If you find something..please raise PR ...will be happy to merge it.

Firstly, Thanks for this Library.

This Segregation of Showing PDF, WORD, EXCEL, PPT in the Picker worked really well for my app. Now as I'm Porting my code to support Android 11. I Realize we need to use Storage Access Framework as suggested by official docs.. but do let us know if using this Document Picker in current form if possible in Andorid 11 ?

Also, In Any case I guess only Document Picker might get deprecated in this library ? not anything else, as my app still use this library. Please share with us a detailed Explanation on ReadMe about how things will look like on >=Android11 . As, now is the time we start writing support for Andorid 11.

Thanks Again.

dishantghai avatar May 17 '20 14:05 dishantghai

document not showing in Android 10 API 30, Samsung Galaxy Note 10+

---Not working

            String[] docs = {".doc", ".docx"};
            String[] pdfs = {".pdf"};
            FilePickerBuilder.getInstance()
                    .setMaxCount(1)
                    .setActivityTitle("Select file")
                    .addFileSupport("PDF", pdfs, R.drawable.pdf)
                    .addFileSupport("DOC", docs, R.drawable.doc)
                    .enableDocSupport(true)
                    .enableSelectAll(false)
                    .sortDocumentsBy(SortingTypes.name)
                    .withOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
                    .pickFile(LeadDocumentListFragment.this, PICK_FILE);

sajidbelim99 avatar Jan 28 '21 05:01 sajidbelim99