【发布时间】:2015-09-22 14:43:17
【问题描述】:
我有从 Google Drive 下载的文件列表。这些文件具有不同的 mimeType,例如
"application/vnd.google-apps.folder"
"application/vnd.google-apps.file"
"application/pdf"
"video/mpeg"
"application/vnd.ms-powerpoint.presentation.macroEnabled.12"
如何以新的意图打开这些文件?
同样要打开文件,我应该使用 id(0B_uvNTGVtbi****zOS1WY78yVlU) 或标题 (RJ_****_462324_20417.pdf)
目前我正在使用,但“Android 系统已停止”:)
Intent myIntent = new Intent(Intent.ACTION_VIEW);
myIntent.setData(Uri.parse(localFile.getTitle()));
myIntent.setType("*/*");
Intent intent = Intent.createChooser(myIntent, "Choose an application to open with:");
context.startActivity(intent);
【问题讨论】:
-
当您说“我有一个列表...”时,请指定一个列表内容(文件标题、文件 ID、...)
-
文件和文件夹列表(不是物理文件),包含标题、id、mimetype、上次修改、已删除、已注视等所有字段。这些列表是我通过 Google Drive Api 获得的。
标签: java android android-intent google-drive-api google-drive-android-api