Details
Description
Hello,
QDir seems to have a problem to list entries into Android/Download directory, but only from Android 10 (Specifically, on a OnePlus smartphone).
This code returns always an empty "entries" list:
// Of course, this is added to manifest: <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE "/> ... // Runtime permissions, as suggested by Android guidelines const QVector<QString> permissions({"android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.READ_EXTERNAL_STORAGE"}); for(const QString &permission : permissions){ auto result = QtAndroid::checkPermission(permission); if(result == QtAndroid::PermissionResult::Denied){ QtAndroid::requestPermissionsSync(QStringList({permission})); } } // Try to read entries QDir directory; directory.setPath(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)); auto entries = directory.entryInfoList({"*.bin", "*.json"}, QDir::NoDotAndDotDot | QDir::AllEntries);
But this works fine on older Android versions with others smartphones.
(and of course i ensured to put *.bin files into Download)
EDIT Sept 14h 2020: the pb is still here on a OnePlus 8 even with Qt 5.15.1:
ALL files in "/storage/emulated/0/Download" = ()