Android Google Drive API无法查询文件夹

时间:2018-09-08 11:58:54

标签: android google-drive-api google-drive-android-api

所有文件都在MetadataBuffer中,但不包括文件夹。

            Tasks.await(driveClient.requestSync());
            Query q = new Query.Builder()
                    .addFilter(Filters.in(SearchableField.PARENTS, rootFolder.getDriveId()))
                    .addFilter(Filters.eq(SearchableField.TRASHED, false))
                    .build();
            Task<MetadataBuffer> queryTask = driveResourceClient.query(q);
            MetadataBuffer query = Tasks.await(queryTask);
            for (int i = 0; i < query.getCount(); i++) {
                Log.d(TAG, query.get(i).getTitle());
            }

如何列出子文件夹?

我已经尝试过.addFilter(Filters.eq(SearchableField.MIME_TYPE,“ application / vnd.google-apps.folder”)),也无法正常工作。.

谢谢

0 个答案:

没有答案