我正在尝试创建一个新的 Excel 文件并在 Android 应用程序中对其进行编辑。我正在使用 Google 云端硬盘 android API。如果我使用:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
作为 MIME 类型,我可以在 Drive 上看到该文件,并且在编辑它时,Drive 会将其复制并转换为自己的类型作为一个新文件。所以当我用我的应用程序取回这个文件时,文件仍然是空的。
如果我使用:
application/vnd.google-apps.spreadsheet
作为 MIME 类型,Google Drive 响应它成功创建了文件,但我在 Drive 上看不到它。
有什么想法吗?
最佳答案
application/vnd.google-apps.spreadsheet 是 Google 电子表格的 MIME 类型,而不是 excel 文件。您目前无法通过 Android API 创建 Google 电子表格(它返回成功是一个错误。)
如果要创建 Microsoft excel 文档,则需要 excel MIME 类型:application/vnd.ms-excel
关于Android google drive api 创建和编辑 excel 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25398901/