【发布时间】:2014-02-07 18:31:50
【问题描述】:
我正在使用 Android 的新文件选择器让用户打开我的文件。我正在尝试选择一个私钥文件(*.key,pem 格式):
Intent i = new Intent(Intent.ACTION_OPEN_DOCUMENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
[...]
construct supportedMimeTypesArray as array with
"application/x-pem-file"
"application/pkcs8"
[...]
i.putExtra(Intent.EXTRA_MIME_TYPES, supportedMimeTypesArray);
这在从内部存储中选择文件时有效。但是当我尝试从 Google 打开文件时,Google 驱动器会将文件清空。
文件是使用浏览器上传的。
有什么方法可以显示 Google 驱动器认为文件是什么 mime 类型?
【问题讨论】:
标签: android google-drive-api mime-types android-4.4-kitkat