安卓如何打开一个.doc文件的延伸? [英] Android how to open a .doc extention file?

查看:101
本文介绍了安卓如何打开一个.doc文件的延伸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有任何可能的方式来打开一个.doc文件的延伸?  如果可能的话,请告诉我该怎么做。 感谢名单

Is there any possible way to open a .doc extention file ? If possible then please tell me how to do it. Thanx

推荐答案

不同的iOS,安卓本身不支持渲染.doc或.PPT文件。您正在寻找一个公共的意图,让您的应用程序重复使用其他应用的活动,以显示这些文件类型。但是,这将只适用于支持该意向已经安装的应用程序的电话。

Unlike iOS, Android itself does not support rendering .doc or .ppt files. You are looking for a public intent that allows your app to reuse other apps' activities to display these document types. But this will only work for a phone that has an app installed that supports this Intent.

<一个href="http://developer.android.com/guide/topics/intents/intents-filters.html">http://developer.android.com/guide/topics/intents/intents-filters.html

如果您已经安装了一些应用程序,然后使用此意图:

or if you have installed some app then use this Intent:

//Uri uri = Uri.parse("file://"+file.getAbsolutePath());
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(Intent.ACTION_VIEW);
String type = "application/msword";
intent.setDataAndType(Uri.fromFile(file), type);
startActivity(intent);  

这篇关于安卓如何打开一个.doc文件的延伸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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