打开PPT档案 [英] Opening PPT-Files

查看:190
本文介绍了打开PPT档案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打开一个PPT文件用我的应用程序。如何检查是否有可以显示这些文件安装在设备上,我怎么能启动它的应用程序?

I want to open a PPT-file with my app. How can I check if there is an app that can display these files installed on the device and how can I launch it?

推荐答案

尝试这样的事情。还没有尝试,但可能工作

Try something like this. Havent tried but might work

final Uri uri = Uri.fromFile(file); 
final Intent intent = new Intent(Intent.ACTION_VIEW); 
intent.setDataAndType(uri, "application/vnd.ms-powerpoint"); 

PackageManager pm = getPackageManager();
List<ResolveInfo> list = pm.queryIntentActivities(intent, 0);
if(list.size() > 0)
   startActivity(context, intent);

这篇关于打开PPT档案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆