Closed amanzan closed 2 years ago
Did other files show normally?
it's seems all documents files not show , other files like mp3 mp4 mov works fine
FilePickerManager .from(this) .storageType( getString(R.string.select_) , FilePickerConfig.STORAGE_CUSTOM_ROOT_PATH) .enableSingleChoice() .maxSelectable(1) //.filter(aFilter) .showHiddenFiles(false) .forResult(FilePickerManager.REQUEST_CODE);
The above code is all your codes in the project? If not, just post all of them.
yes it's all code, and tested in these configs compileSdkVersion 30 minSdkVersion 21 targetSdkVersion 30
Phone: Redmi note 9- android 11
Could you list download folder manually by File.listfiles ?
Same here on Realme7 with Android 11 FilePickerManager.from(ProjectLoaderActivity.this).enableSingleChoice().forResult(FilePickerManager.REQUEST_CODE);
Solved:
Add to Manifest;
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
Ask user for permission with:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
if (!Environment.isExternalStorageManager()) {
Uri uri = Uri.parse("package:${BuildConfig.APPLICATION_ID}");
Intent inte = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION,uri);
startActivity(inte);
}
}
@Toprakete Do not recommend Using MANAGE_EXTERNAL_STORAGE
permission. Google Play would conduct special review.
@rosuH Yes, but that's ok, nothing to hide. As in https://developer.android.com/training/data-storage/manage-all-files to read, for 'On-device file search' it's ok to use this, I think
This issue has been confirmed, on Android 11 platforms, the application READ_EXTERNAL_STORAGE
can only read media files, but document types and binary files will be ignored.
Thank you for your feedback!
I have PDF files downloaded in my device, but AndroidFilePicker does not show them, so I cannot select them. How can I do this?