Intent用于activity之间, fragmetn之间, 或者APP间通信, 主要包含数据和Action两部分:

常见的action是字符串形式的activity指定

Intent intent = new Intent("com.example.intents.MainActivity");

对系统内的action, 也可以用action constant

Intent intent = new Intent(android.content.Intent.ACTION_ALL_APPS);

对应用内的action, 也可以用类定义的形式

Intent intent = new Intent(this, MainActivity.class);

对Data填充, 有以下几种方式

直接填充

intent.setData(Uri.parse("11122333"));

以设置 KEY-VALUE的方式填充

intent.putExtra("1111", "1112222");

用bundle填充

		extras.putString("2222", "222223333");
intent.putExtras(extras);

此外intent还可以指定返回值类型和action筛选目录等

build Intent的更多相关文章

  1. android intent 5.1

    1.intent 6 items action, data(uri &type),Component name,Extras,flags 2.data---uri & type 不管使 ...

  2. android 开发 获取各种intent (图片、apk文件、excel、pdf等文件)

    public static Intent openFile(String filePath){ File file = new File(filePath); if(!file.exists()) r ...

  3. ( 转转)Android初级开发第九讲--Intent最全用法(打开文件跳转页面等)

    大家好,今天跟大家谈谈Intent的用法. Intent在安卓中主要用于打开另外一个页面,这个页面可能是一个activity也可能是一个应用,也可能是     其它…… 且看下面介绍,总结摘抄网友一些 ...

  4. 用intent打开各种类型文件

    public class MyIntent { //android获取一个用于打开HTML文件的intent public static Intent getHtmlFileIntent( Strin ...

  5. android用于打开各种文件的intent

    import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.n ...

  6. phonegap 附件下载及打开附件

    出处:http://my.oschina.net/u/1011854/blog/169434 再次 谢谢作者! 在开发web app并且使用phonegap的情况下,附件下载着实是一件令人头疼的事,什 ...

  7. android开发之Notification学习笔记

    今天总结了一下Notification的使用,与大家分享一下. MainActivity.java: 本文参考:http://www.jb51.net/article/36567.htm,http:/ ...

  8. Android Wear 开发入门——怎样创建一个手机与可穿戴设备关联的通知(Notification)

    创建通知 为了创建在手机与可穿戴设备中都能展现的通知,能够使用 NotificationCompat.Builder.通过该类创建的通知,系统会处理该通知是否展如今手机或者穿戴设备中. 导入必要的类库 ...

  9. android wear开发:为可穿戴设备创建一个通知 - Creating a Notification for Wearables

    注:本文内容来自:https://developer.android.com/training/wearables/notifications/creating.html 翻译水平有限,如有疏漏,欢迎 ...

随机推荐

  1. mysql优化21条

    今天一个朋友向我咨询怎么去优化 MySQL,我按着思维整理了一下,大概粗的可以分为21个方向. 还有一些细节东西(table cache, 表设计,索引设计,程序端缓存之类的)先不列了,对一个系统,初 ...

  2. shell脚本调试 分类: 学习笔记 linux ubuntu 2015-07-14 12:49 53人阅读 评论(0) 收藏

    1.sh -x script 这将执行脚本并显示所有变量的值 如,脚本: #!/bin/bash #a test about shift if [ $# -le 0 ] then echo " ...

  3. Winform 程序中dll程序集嵌入exe可执行文件

    关于这方面,Google一下有很多方法,参考: http://blog.csdn.net/astonqa/article/details/7300856 但按照以上的方法我并没有成功,于是继续找到了一 ...

  4. HTML5常用标签

    section 板块,用于划分页面的不同区域或者划分文章里不同的节 ↓  header 页面头部或者板块section头部 ↓  footer 页面底部或者section底部 ↓  nav 导航(包含 ...

  5. Java-Android 之电话拨号源码

    file:///F:/workspace3/Android_ver2.4/src/cn/szy/com/MainActivity.java package cn.szy.com; import and ...

  6. Android WebView和JavaScript交互

    JavaScript在现在的网页设计中用得很多,Android 的WebView可以载入网页,WebView也设计了与JavaScript通信的桥梁.这篇主要介绍一下WebViewk控件如何和Java ...

  7. 利用Graphviz 画结构图[转]

    转自:http://www.cnblogs.com/sld666666/archive/2010/06/25/1765510.html 利用Graphviz 画结构图   1. Graphviz介绍 ...

  8. java中怎么进行字符串替换?

    String str = "test.doc"; String newStr = str.replaceAll("doc","html");

  9. MySQL性能状态查看方式

    1. QPS(每秒Query量) QPS = Questions(or Queries) / seconds mysql > show global status like 'Question% ...

  10. oracle 数据库关闭的的几种方式总结

    shutdown的几种方式,shutdown abort的一些弊端有哪些   1.shutdown normal        正常方式关闭数据库.    2.shutdown immediate   ...