我能够使用Google驱动器API在谷歌驱动器中创建文本和.doc文件。但当我设置MIME类型为application/vnd.google-apps.document
该应用程序崩溃与日志在谷歌驱动器中创建谷歌文档
可能不会创建使用此方法的快捷方式文件。使用 DriveFolder.createShortcutFile()代替
这是怎么尝试创建文件
MetadataChangeSet changeSet = new MetadataChangeSet.Builder()
.setTitle("New file")
.setMimeType("application/msword")// this works
//.setMimeType("application/vnd.google-apps.document") //this does not work
.setStarred(true).build();
Drive.DriveApi.getRootFolder(getGoogleApiClient())
.createFile(getGoogleApiClient(), changeSet, null /* DriveContents */)
.setResultCallback(fileCallback);
是否有可能从驱动器API创建谷歌文件?
查看Web服务的[创建文件](https://developers.google.com/drive/v3/web/integrate-create#create_a_shortcut_to_a_file),Mime Type类似于创建快捷方式(即日志显示的内容)。我目前没有看到你如何创建文件。如果您想了解更多信息,可以查看Drive API for Android文档中的[创建文件](https://developers.google.com/drive/android/create-file) – adjuremods
Google文档不是真实的文件,它们是虚拟的,并不存储在驱动器文件夹区域中。 –
@Brianfromstatefarm所以它不可能使用API创建一个新的谷歌文档文件? –