- 浏览: 39738 次
- 性别:
- 来自: 北京
文章分类
最新评论
http://blog.csdn.net/wenwanwen/article/details/7032574
AndroidExcel
//android获取一个用于打开PPT文件的intent
public static Intent getPptFileIntent( String param )
{
Intent intent = new Intent("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Uri uri = Uri.fromFile(new File(param ));
intent.setDataAndType(uri, "application/vnd.ms-powerpoint");
return intent;
}
//android获取一个用于打开Excel文件的intent
public static Intent getExcelFileIntent( String param )
{
Intent intent = new Intent("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Uri uri = Uri.fromFile(new File(param ));
intent.setDataAndType(uri, "application/vnd.ms-excel");
return intent;
}
//android获取一个用于打开Word文件的intent
public static Intent getWordFileIntent( String param )
{
Intent intent = new Intent("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Uri uri = Uri.fromFile(new File(param ));
intent.setDataAndType(uri, "application/msword");
return intent;
}
//android获取一个用于打开CHM文件的intent
public static Intent getChmFileIntent( String param )
{
Intent intent = new Intent("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Uri uri = Uri.fromFile(new File(param ));
intent.setDataAndType(uri, "application/x-chm");
return intent;
}
//android获取一个用于打开文本文件的intent
public static Intent getTextFileIntent( String param, boolean paramBoolean)
{
Intent intent = new Intent("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (paramBoolean)
{
Uri uri1 = Uri.parse(param );
intent.setDataAndType(uri1, "text/plain");
}
else
{
Uri uri2 = Uri.fromFile(new File(param ));
intent.setDataAndType(uri2, "text/plain");
}
return intent;
}
//android获取一个用于打开PDF文件的intent
public static Intent getPdfFileIntent( String param )
{
Intent intent = new Intent("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Uri uri = Uri.fromFile(new File(param ));
intent.setDataAndType(uri, "application/pdf");
return intent;
}
(PDF、word、excel、ppt、chm、文本)
发表评论
-
设置内存卡资源图片
2013-03-12 10:11 480String imageDir = Environment. ... -
android字体过长渐变效果
2013-01-30 15:59 665使用 android:singleLine="t ... -
自定义之checkbox
2013-01-08 09:16 618android中自定义checkbox大小和图片 (转) ... -
Android中Activity,View,Window之间的关系(转)
2012-12-03 09:11 11301.首先来看Activity中的attach()方法,在调用o ... -
Dialog的dismiss和cancel 区别 (转)
2012-12-03 09:13 1847Dialog的dismiss和cancel AlertDial ... -
android应用程序适配在不同的手机上(转)
2012-12-03 09:15 490如何将一个应用程序适 ... -
android 堆栈 清理 (转)
2012-12-03 09:16 665启动任务 当一个activity ... -
Android权限共享UID(转)
2012-12-03 09:16 548共享UID 安装在设备中 ... -
ViewPager+TabHost 实现选项卡页面间滑动(转)
2012-12-04 09:19 919转自http://flycatdeng.iteye.com/b ... -
android扫描商品条形码
2012-12-04 09:19 997(转自http://marshal.easymorse.com ... -
基于Android平台的NFC技术的应用实现 (转)
2012-12-04 09:20 1401转自http://1679554191.iteye.com/b ... -
Android API包名及包的功能的中文介绍
2012-11-30 09:38 977android 包含应用平台和在定义应用程序所用到and ... -
Android 自动解锁 KeyguardManager(键盘管理器)(转)
2012-11-30 09:39 934写一个Activity启动该服务即可,用一个线程开启服务, ... -
Android之Service与IntentService的比较 .
2012-11-30 09:41 678转自http://blog.csdn.net/zhf19890 ... -
AlarmManager的使用
2012-11-30 09:42 671AlarmManager的作用文档中的解释是:在特定的时刻为 ... -
ActivityGroup之生命周期
2012-12-04 09:20 783Activity的生命周期已经 ... -
ActivityGroup之切换activity
2012-12-04 09:20 662前言 在一个主界面中做Activity切换一般都会用T ... -
Android SurviceView的触控和轨迹球事件 .
2012-12-05 14:10 1059SurfaceView 的触控和轨迹球事件 1,改开始什 ... -
home键屏蔽
2012-12-05 14:11 6191. 在activity中加上这段代码(重写onAttache ... -
彻底删除某个APK的方法
2012-12-05 14:11 10681. 连接ADB, 执行adb remount 2. 执行a ...
相关推荐
android用于打开各种文件的intent
* 打开文件 * @param file */ private void openFile(File file){ Intent intent = new Intent(); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); //设置intent的Action属性 intent.setAction...
一个Android文件下载Download程序...调用getMIMEType()来取得MimeType,设置intent的file与MimeType ,判断文件MimeType的method,取得扩展名,依扩展名的类型决定MimeType,如果无法直接打开,就跳出软件列表给用户选择.
一个Android文件管理器APP源码,类似于360手机助手的功能,可以记录文件使用次数,... 本SD卡扫描程序还自定义了android Intent类,可用于获取打开以下文件的intent:PDF,PPT,WORD,EXCEL,CHM,HTML,TEXT,AUDIO,VIDEO。
预览移动设备支持的任何类型的文件。 iOS :它使用 Android :它使用ACTION_VIEW Intent启动与指定文件关联的默认应用。 Windows :启动与指定文件关联的默认应用程序。 入门 $ npm install react-native-file-...
,调用getMIMEType()来取得MimeType,设置intent的file与MimeType ,判断文件MimeType的方法,如果无法直接打开,就跳出软件列表给用户选择。变量声明:items:存放显示的名称,paths:存放文件路径,rootPath:起始...
----------------------------------- Android 编程基础 1 封面----------------------------------- Android 编程基础 2 开放手机联盟 --Open --Open --Open --Open Handset Handset Handset Handset Alliance ...
打开多种类型的文件: 21 Uninstall 程序 24 14、将Uri转为绝对路径 24 15、Android支持多种语言 25 16、四种动画的设置属性 25 1、尺寸伸缩动画效果 25 2、translate 位置转移动画效果 27 3、rotate 旋转动画效果 ...
//如果是媒体文件直接打开播放 openFile(pathEditText.getText().toString()); } else { //如果是目录打开目录下文件 getFileDir(pathEditText.getText().toString()); } } ...
8.4 设计前往打开网页功能——Intent与Uri.parse 8.5 将网络图像网址放入Gallery中显示——URL.URLConnection.BaseAdapter 8.6 即时访问网络图文件展示——HttpURLConnection 8.7 手机气象局,实时卫星云图——...
8.4 设计前往打开网页功能——Intent与Uri.parse 8.5 将网络图像网址放入Gallery中显示——URL.URLConnection.BaseAdapter 8.6 即时访问网络图文件展示——HttpURLConnection 8.7 手机气象局,实时卫星云图——...
8.4 设计前往打开网页功能——Intent与Uri.parse 8.5 将网络图像网址放入Gallery中显示——URL.URLConnection.BaseAdapter 8.6 即时访问网络图文件展示——HttpURLConnection 8.7 手机气象局,实时卫星云图——...
]修复Android下打开客户端的同时下载apk文件,ios和android打开客户端的时间有差异,提供配置项 [!]测试发现魅族手机下的无法识别app注册的协议(如etao://item),可通过降级引导用户操作。 V1.1 [!]提供基础的js...
8.4 设计前往打开网页功能——Intent与Uri.parse 8.5 将网络图像网址放入Gallery中显示——URL.URLConnection.BaseAdapter 8.6 即时访问网络图文件展示——HttpURLConnection 8.7 手机气象局,实时卫星云图——...
6.4 开始与停止系统服务——Service与Runnable整合并用 6.5 通过短信发送email通知——BroadcastReceiver与Intent整合 6.6 手机拨接状态——PhoneStateListener之onCallStateChanged 6.7 有来电,发送邮件通知——...
8.4 设计前往打开网页功能——Intent与Uri.parse 8.5 将网络图像网址放入Gallery中显示——URL.URLConnection.BaseAdapter 8.6 即时访问网络图文件展示——HttpURLConnection 8.7 手机气象局,实时卫星云图——...
8.4 设计前往打开网页功能——Intent与Uri.parse 8.5 将网络图像网址放入Gallery中显示——URL.URLConnection.BaseAdapter 8.6 即时访问网络图文件展示——HttpURLConnection 8.7 手机气象局,实时卫星云图——...