什么是Google云端硬盘电子表格的MIME类型?

时间:2015-01-16 05:54:02

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

我正在尝试制作google drive Spreadsheet的演示版...请告诉我用于电子表格的MIME类型。

    new Thread() {
        @Override
        public void run() {
            // write content to DriveContents
            OutputStream outputStream = driveContents.getOutputStream();
            Writer writer = new OutputStreamWriter(outputStream);
            try {
                writer.write("Google Drive SpreadSheet");
                writer.close();
            } catch (IOException e) {
                Log.e(TAG, e.getMessage());
            }

            MetadataChangeSet changeSet = new MetadataChangeSet.Builder()
                    .setTitle("Android Demo")
                    .setMimeType("text/plain")
                    .setStarred(true).build();

            // create a file on root folder
            Drive.DriveApi.getRootFolder(getGoogleApiClient())
                    .createFile(getGoogleApiClient(), changeSet, driveContents)
                    .setResultCallback(fileCallback);
        }
    }.start();
}
};

1 个答案:

答案 0 :(得分:2)

下表列出了特定于Google Apps和Google云端硬盘的MIME类型。 enter image description here

可在此处找到:Supported MIME Types

对于Google驱动程序表,我认为您正在查看application/vnd.google-apps.spreadsheet