Android如何打开.doc扩展名文件? [英] Android how to open a .doc extension file?

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

问题描述

是否可以打开.doc扩展名文件?

Is there any possible way to open a .doc extension file?

推荐答案

与iOS不同,Android本身不支持呈现.doc或.ppt文件.您正在寻找一种公共意图,该意图允许您的应用重复使用其他应用的活动以显示这些文档类型.但这仅适用于已安装支持该Intent的应用的手机.

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.

http://developer.android.com/guide/topics/intents/intents-filters .html

或者如果您已经安装了某些应用程序,则使用此Intent:

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);  

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

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