参考资料:http://www.oschina.net/code/snippet_166763_6502

//以下是常用到的Intent的URI及其示例,包含了大部分应用中用到的共用Intent。
//一、打开一个网页,类别是Intent.ACTION_VIEW
Uri uri = Uri.parse(“http://blog.3gstdy.com/”);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
//二、打开地图并定位到一个点
Uri uri = Uri.parse(“geo:52.76,-79.0342″);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
//三、打开拨号界面 ,类型是Intent.ACTION_DIAL
Uri uri = Uri.parse(“tel:10086″);
Intent intent = new Intent(Intent.ACTION_DIAL, uri);
//四、直接拨打电话,与三不同的是,这个直接拨打电话,而不是打开拨号界面
Uri uri = Uri.parse(“tel:10086″);
Intent intent = new Intent(Intent.ACTION_CALL, uri);
//五、卸载一个应用,Intent的类别是Intent.ACTION_DELETE
Uri uri = Uri.fromParts(“package”, “xxx”, null);
Intent intent = new Intent(Intent.ACTION_DELETE, uri);
//六、安装应用程序,Intent的类别是Intent.ACTION_PACKAGE_ADDED
Uri uri = Uri.fromParts(“package”, “xxx”, null);
Intent intent = new Intent(Intent.ACTION_PACKAGE_ADDED, uri);
//七、播放音频文件
Uri uri = Uri.parse(“file:///sdcard/download/everything.mp3″);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
intent.setType(“audio/mp3″);
//八、打开发邮件界面
Uri uri= Uri.parse(“mailto:admin@3gstdy.com”);
Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
//九、发邮件,与八不同这里是将邮件发送出去,
Intent intent = new Intent(Intent.ACTION_SEND);
String[] tos = { “admin@3gstdy.com” };
String[] ccs = { “webmaster@3gstdy.com” };
intent.putExtra(Intent.EXTRA_EMAIL, tos);
intent.putExtra(Intent.EXTRA_CC, ccs);
intent.putExtra(Intent.EXTRA_TEXT, “I come from http://blog.3gstdy.com”);
intent.putExtra(Intent.EXTRA_SUBJECT, “http://blog.3gstdy.com”);intent.setType(“message/rfc882″);
Intent.createChooser(intent, “Choose Email Client”);
//发送带附件的邮件
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_SUBJECT, “The email subject text”);
intent.putExtra(Intent.EXTRA_STREAM, “file:///sdcard/mysong.mp3″);
intent.setType(“audio/mp3″);
startActivity(Intent.createChooser(intent, “Choose Email Client”));
//十、发短信
Uri uri= Uri.parse(“tel:10086″);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
intent.putExtra(“sms_body”, “I come from http://blog.3gstdy.com”);
intent.setType(“vnd.Android-dir/mms-sms”);
//十一、直接发邮件
Uri uri= Uri.parse(“smsto://100861″);
Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
intent.putExtra(“sms_body”, “3g android http://blog.3gstdy.com”);
//十二、发彩信
Uri uri= Uri.parse(“content://media/external/images/media/23″);
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(“sms_body”, “3g android http://blog.3gstdy.com”);
intent.putExtra(Intent.EXTRA_STREAM, uri);
intent.setType(“image/png”);
//十三、# Market 相关
//1 //寻找某个应用
Uri uri = Uri.parse(“market://search?q=pname:pkg_name”);
Intent it = new Intent(Intent.ACTION_VIEW, uri);
startActivity(it);
//where pkg_name is the full package path for an application
//2 //显示某个应用的相关信息
Uri uri = Uri.parse(“market://details?id=app_id”);
Intent it = new Intent(Intent.ACTION_VIEW, uri);
startActivity(it);
//where app_id is the application ID, find the ID
//by clicking on your application on Market home
//page, and notice the ID from the address bar
//十四、路径规划
Uri uri = Uri.parse(“http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en”);
Intent it = new Intent(Intent.ACTION_VIEW, uri);
startActivity(it);

自己倒是还没试过这么多,等有时间一个一个试试!!!

Android开发常用的Intent的URI及示例的更多相关文章

  1. 36个Android开发常用代码片段

    //36个Android开发常用代码片段 //拨打电话 public static void call(Context context, String phoneNumber) { context.s ...

  2. Android开发常用工具汇总

    Android开发常用工具汇总,本文章不断更新完善 一.数据库小工具Sqlite Developer  SQLite,是一款轻型的数据库,是遵守ACID的关系型数据库管理系统,它的设计目标是嵌入式的, ...

  3. 转发—Android开发常用的插件及工具

    作者:蓝之风 出处:http://www.cnblogs.com/vaiyanzi/ Android开发常用的插件及工具 1.GitHub,这个不管是做安卓还是其他,只要是开发就必上的网站,也是天朝没 ...

  4. Android开发常用开源框架:图片处理

    https://blog.csdn.net/SGQ_CSDN/article/details/79910709 Android开发常用开源框架:图片处理 框架名称 功能描述 Android Unive ...

  5. Android开发-API指南-Intent和Intent过滤器

    Intents and Intent Filters 英文原文:http://developer.android.com/guide/components/intents-filters.html 采 ...

  6. Android开发3:Intent、Bundle的使用和ListView的应用 、RelativeLayout(相对布局)简述(简单通讯录的实现)

    前言 啦啦啦~博主又来骚扰大家啦~大家是不是感觉上次的Android开发博文有点长呢~主要是因为博主也是小白,在做实验的过程中查询了很多很多概念,努力去理解每一个知识点,才完成了最终的实验.还有就是随 ...

  7. Android开发常用工具类

    来源于http://www.open-open.com/lib/view/open1416535785398.html 主要介绍总结的Android开发中常用的工具类,大部分同样适用于Java. 目前 ...

  8. Android开发中使用Intent跳转到系统应用中的拨号界面、联系人界面、短信界面

    现在开发中的功能需要直接跳转到拨号.联系人.短信界面等等,查找了很多资料,自己整理了一下. 首先,我们先看拨号界面,代码如下: Intent intent =new Intent(); intent. ...

  9. 最全Android开发常用工具类

    主要介绍总结的Android开发中常用的工具类,大部分同样适用于Java. 目前包括  HttpUtils.DownloadManagerPro.Safe.ijiami.ShellUtils.Pack ...

随机推荐

  1. centos7 安装VMware tools 出现The path "" is not a valid path to the 3.10.0-514.el7.x86_64 kernel headers

    执行:yum install "kernel-devel-uname-r == $(uname -r)"

  2. Java中常用的解决乱码的几种方法

    乱码有时候是一个非常让人头疼的问题,这里就总结一下常用的解决乱码的方法. 只知道的用法,却不明白为什么这么用…… 一. 在Java代码中: request.setCharacterEncoding(& ...

  3. 【Tomcat】1.Tomcat在Windows系统的安装和使用

    1.下载与安装 安装Tomcat的[前提条件]是安装好JDK或者JRE(本文略过)Tomcat在Windows系统中可以通过[压缩包]或[安装包]来安装建议使用[安装包]来简化安装步骤登录官网http ...

  4. 微信公众号的SpringBoot+Quartz的定时任务Demo

    SpringBoot整合quartz并不难,难在普通类实现了Job接口后等于实例化交给quartz,不受Spring管理,则service层等等其他依赖的注入将无法注入,这也是难点之一. 解决方法: ...

  5. Node.js 开发技能图谱

    # Node.js 开发技能图谱 ## Node.js 语言环境搭建 - Node.js 安装(3m大法:nvm.npm.nrm)- Node.js 命令- Node.js开发工具(推荐vscode) ...

  6. UML的类型

    分类 UML从考虑系统的不同角度出发,定义了用例图.类图.对象图.包图.状态图.活动图.序列图.协作图.构件图.部署图等10种图. 常见的UML图有用例图(Use Case Diagram).类图(C ...

  7. 修改PhpStorm创建Php类文件时头部作者

    原文链接:https://segmentfault.com/a/1190000015617093 首先打开phpstorm后找到Setting/Editor/Inspections/PHP/File ...

  8. 使用函数指针模拟C++多态

    #include <iostream> using namespace std; class Base { public : void display() { cout << ...

  9. cs224d 作业 problem set1 (二) 简单的情感分析

    使用在上一篇博客中训练好的wordvector 在这一节进行情感分析. 因为在上一节中得到的是一个词就是一个向量 所以一句话便是一个矩阵,矩阵的每一列表示一个词向量 情感分析的前提是已知一句话是 (超 ...

  10. 关于jsp:include 动态引入的值传递问题(数据共享问题)

    <jsp:include page="search.jsp" flush="true"> <jsp:param name="gh&q ...