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快捷键

    \c  clear  放弃正在输入的命令\h  help   显示一份命令清单\q   exit  或  quit  退出Mysql程序         在linux里面可以使用Ctr+D快捷键\s  ...

  2. [转] npm命令概述

    PS:问题,nvm找不到正确的下载server NVM_NODEJS_ORG_MIRROR=http://nodejs.org/dist nvm ls-remote NVM_NODEJS_ORG_MI ...

  3. eclipse4.3 kepler中安装maven

    1.软件准备 a:Eclipse 4.3 http://www.eclipse.org/downloads/ b:maven http://maven.apache.org/download.cgi ...

  4. table 数据少时 ,tr高度变化

    table设置固定高度,如果点击分页,数据条数发生变化时,tr的高度会变化. 解决办法:table外  加div层  将table隔离.

  5. uploadify插件实现多个图片上传并预览

    使用uploadify插件可方便实现图片上传功能.兼容ie6.ie7. 上传成功之后使用插件的回调函数读取json数据,根据url实现图片预览. 效果图: 点击浏览文件上传图片,图片依次在右侧显示预览 ...

  6. js自定义方法名

    自定义方法名: <script language="javascript" type="text/javascript">window.onload ...

  7. Activity间的跳转,startActivity与startActivityForResult

    JreduCh04 2016-07-30跳转 (由一个画面跳转到另一个画面)两种方法:Intent中 startActivity.startActivityForResult.后者可设置request ...

  8. listView中的button控件获取item的索引

    在listview中的listitem设置事件响应,如果listitem中有button控件,这时候listitem就不会捕获到点击事件,而默认的是listitem中的button会捕获点击事件.那么 ...

  9. android Services注意地方

    使用service前需要在manifest声明: <manifest ... > ... <application ... > <service android:name ...

  10. C#中Dictionary、ArrayList、Hashtable和Array的区别

    IDictionary接口是所有字典类集合的基本接口,该接口与ICollection,IEnumerable接口是所有非泛型类集合的最基本的接口 IEnumerable接口用于公开枚举数,该枚举数支持 ...