由文件的路径通过其他应用打开图片,PPT,Word,excel,PDF
2016-09-09 19:11
579 查看
1.打开图片
Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse("file://"+"/sdcard/test.jpg"),"image/*"); startActivity(intent);
2.打开PPT,Word,excel文件
Intent intent = new Intent(Intent.ACTION_VIEW); //intent.setDataAndType(Uri.parse("file://"+file_path),"application/vnd.ms-excel"); intent.setDataAndType(Uri.parse("file://"+file_path),"application/msword"); startActivity(intent);
3.打开PDF文件
File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/example.pdf"); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.fromFile(file), "application/pdf"); intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); startActivity(intent);
相关文章推荐
- 笔记-Android中打开各种格式的文件(apk、word、excel、ppt、pdf、音视频、图片等)
- Android中打开各种格式的文件(apk、word、excel、ppt、pdf、音视频、图片等)
- 笔记-Android中打开各种格式的文件(apk、word、excel、ppt、pdf、音视频、图片等)
- 应用内展示word ,pdf, excel,ppt等文件
- Android遍历获取Office格式(Word,Excel,PPT,PDF)的文件并打开
- android用于打开各种文件的intent,包括以下文件PDF,PPT,WORD,EXCEL,CHM,HTML,TEXT,AUDIO,VIDEO
- Android遍历获取Office格式(Word,Excel,PPT,PDF)的文件并打开
- 将Office(如:Word、Excel、PPT 等)文件转PDF(通过OpenOffice实现)
- android打开pdf ppt word excel chm html text 文件的intent
- android用于打开各种文件的intent,包括以下文件PDF,PPT,WORD,EXCEL,CHM,HTML,TEXT,AUDIO,VIDE(代码待完善)
- android Intent打开各种类型文件(PDF、word、excel、ppt、chm)
- Android应用内展示word、excel、pdf、ppt等文件(讯的Tbs)
- 如何通过WPS 2013 API 将Office(Word、Excel和PPT)文件转PDF文件
- android Intent打开各种类型文件((PDF、word、excel、ppt、chm)
- IOS 打开预览pdf、ppt、excel、word、tet、rtf、csv格式的文件,微信文件分享
- PDF文件转化成word,ppt,excel,图片(png,jpg...),tiff,rtf,txt,html,PDF组合,PDF编辑,PDF创建
- android用于打开各种文件的intent,包括以下文件PDF,PPT,WORD,EXCEL,CHM,HTML,TEXT,AUDIO,VIDEO
- android打开pdf ppt word excel等文件
- Android执行打开文件(PDF,PPT,WORD,EXCEL,CHM,HTML,TEXT,AUDIO,VIDEO)的总结
- android Intent打开各种类型文件((PDF、word、excel、ppt、chm)