我在 Android 上使用 Google Drive SDK v2 来获取根文件夹列表。目前我看到了这些必需的步骤——它们似乎永远加载。没有更快的方法吗?
我尝试使用带有 q= 参数的搜索,但我没有让它工作(FileList 与 Files.List) - 不同的 API 级别?
FileList files = drive.files().list().setQ("'root' in parents and mimeType='application/vnd.google-apps.folder' and trashed=false");
这就是我目前所做的:
About about = drive.about().get().execute();
if (about != null) {
ChildList childList = drive.children().list(about.getRootFolderId()).execute();
if (childList != null) {
List<ChildReference> listChildReference = childList.getItems();
for (ChildReference childReference : listChildReference) {
File file = drive.files().get(childReference.getId()).execute();
if (file != null) {
String fileExtension = file.getFileExtension();
String mimeType = file.getMimeType();
if (mimeType != null
&& mimeType.equals("application/vnd.google-apps.folder")
&& (fileExtension == null || fileExtension.equals(""))) {
Log.d(this.getClass().getName(), file.getTitle());
}
}
}
}
}
Android 应用程序最快的是什么?
提前致谢。