Код не сильно отличается от собственного совета Google по адресу: https://developer.android.com/training/ ... ents-files />e.g.
Код: Выделить всё
private void openDirChooser()
{
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
startActivityForResult(intent);
}

it shows up an empty root folder and even a freshly created test folder just shows a disabled button on a Lenovo Tab M11 Android 15 device:
while while log while the log while the log bit haysing the log while the log while the log while the log while the log while the log while the log while the log while the log while the lod это: < /p>
Код: Выделить всё
W/ExternalStorage: Error in checking file equality check.
java.nio.file.NoSuchFileException: /storage/emulated
at sun.nio.fs.UnixFileSystemProvider.isSameFile(UnixFileSystemProvider.java:344)
at java.nio.file.Files.isSameFile(Files.java:1504)
at com.android.externalstorage.ExternalStorageProvider.isRestrictedPath(ExternalStorageProvider.java:352)
at com.android.externalstorage.ExternalStorageProvider.shouldHideDocument(ExternalStorageProvider.java:313)
at com.android.internal.content.FileSystemProvider.queryChildDocuments(FileSystemProvider.java:414)
at com.android.internal.content.FileSystemProvider.queryChildDocuments(FileSystemProvider.java:385)
at android.provider.DocumentsProvider.queryChildDocuments(DocumentsProvider.java:618)
at android.provider.DocumentsProvider.query(DocumentsProvider.java:935)
at android.content.ContentProvider$Transport.query(ContentProvider.java:303)
at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:107)
at android.os.Binder.execTransactInternal(Binder.java:1510)
at android.os.Binder.execTransact(Binder.java:1454)
2025-05-28 11:50:38.942 14736-14747/? W/FileSystemProvider: Queried directory "primary:" is hidden
Код: Выделить всё
2025-05-28 12:05:49.994 16356-16371/? W/FileSystemProvider: Queried directory "primary:Test" is hidden
Подробнее здесь: https://stackoverflow.com/questions/796 ... eal-device
Мобильная версия