如何用Intent打开pptx文件

时间:2014-10-07 18:56:40

标签: android android-intent powerpoint

我想从我的应用中打开一个PowerPoint文件。该文件存储在我的资产文件夹中。我使用这段代码:

Uri helpfile = Uri.parse("content://com.example.myapp/Tutorial.pptx");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(helpfile, "*/*");
startActivity(intent);

我在清单中注册了一个ContentProvider类。

<provider android:name="com.example.myapp.Provider"
android:authorities="com.example.myapp"
android:grantUriPermissions="true"
android:exported="true" />

我也尝试过:

intent.setType("application/vnd.openxmlformats-officedocument.presentationml.presentation");

我被问到我想要完成该操作的应用程序,我选择POLARIS Office 5和Toast出现“不支持的文档类型”。如果我从ASTRO文件管理器启动PPTX文件,POLARIS立即打开。

我错过了什么?

0 个答案:

没有答案