Google drive api 重命名Google驱动器文件,返回null

Google drive api 重命名Google驱动器文件,返回null,google-drive-api,Google Drive Api,我正在使用GD SDK for Android重命名Google驱动器文件,代码如下: File file = new File(); file.setTitle(mNewName); Files.Patch patchRequest = service.files().patch(mId, file); patchRequest.setFields("title"); mUpdatedFile = patchRequest.execute(); 文档中说.execute()应该返回一个Fil

我正在使用GD SDK for Android重命名Google驱动器文件,代码如下:

File file = new File();
file.setTitle(mNewName);
Files.Patch patchRequest = service.files().patch(mId, file);
patchRequest.setFields("title");
mUpdatedFile = patchRequest.execute();

文档中说.execute()应该返回一个File对象,但在这个文件中,只有patched属性被填充,所有其他字段都为null。这是一个bug吗?

您指定只返回“title”:

patchRequest.setFields("title");
此字段参数控制将填充的内容。你需要的是这里所需的最低限度,因为它的效率要高得多