build Intent
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的更多相关文章
- android intent 5.1
1.intent 6 items action, data(uri &type),Component name,Extras,flags 2.data---uri & type 不管使 ...
- android 开发 获取各种intent (图片、apk文件、excel、pdf等文件)
public static Intent openFile(String filePath){ File file = new File(filePath); if(!file.exists()) r ...
- ( 转转)Android初级开发第九讲--Intent最全用法(打开文件跳转页面等)
大家好,今天跟大家谈谈Intent的用法. Intent在安卓中主要用于打开另外一个页面,这个页面可能是一个activity也可能是一个应用,也可能是 其它…… 且看下面介绍,总结摘抄网友一些 ...
- 用intent打开各种类型文件
public class MyIntent { //android获取一个用于打开HTML文件的intent public static Intent getHtmlFileIntent( Strin ...
- android用于打开各种文件的intent
import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.n ...
- phonegap 附件下载及打开附件
出处:http://my.oschina.net/u/1011854/blog/169434 再次 谢谢作者! 在开发web app并且使用phonegap的情况下,附件下载着实是一件令人头疼的事,什 ...
- android开发之Notification学习笔记
今天总结了一下Notification的使用,与大家分享一下. MainActivity.java: 本文参考:http://www.jb51.net/article/36567.htm,http:/ ...
- Android Wear 开发入门——怎样创建一个手机与可穿戴设备关联的通知(Notification)
创建通知 为了创建在手机与可穿戴设备中都能展现的通知,能够使用 NotificationCompat.Builder.通过该类创建的通知,系统会处理该通知是否展如今手机或者穿戴设备中. 导入必要的类库 ...
- android wear开发:为可穿戴设备创建一个通知 - Creating a Notification for Wearables
注:本文内容来自:https://developer.android.com/training/wearables/notifications/creating.html 翻译水平有限,如有疏漏,欢迎 ...
随机推荐
- JMX 与系统管理--转
前言 在 Java 程序的运行过程中,对 JVM 和系统的监测一直是 Java 开发人员在开发过程所需要的.一直以来,Java 开发人员必须通过一些底层的 JVM API,比如 JVMPI 和 JVM ...
- iOS--NSAttributedString使用介绍
iOS–NSAttributedString使用介绍 原文见: http://www.itnose.net/detail/6177538.html http://***/html/topnews201 ...
- TCP/IP协议原理与应用笔记02:断点续传
1.断点续传简介: FTP(文件传输协议的简称)(File Transfer Protocol. FTP)客户端软件断点续传指的是在下载或上传时,将下载或上传任务(一个文件或一个压缩包)人 ...
- Linux编译安装MySQL5.6
为了防止无良网站的爬虫抓取文章,特此标识,转载请注明文章出处.LaplaceDemon/SJQ. http://www.cnblogs.com/shijiaqi1066/p/4311061.html ...
- Java异常之try,catch,finally,throw,throws
Java异常之try,catch,finally,throw,throws 你能区分异常和错误吗? 我们每天上班,正常情况下可能30分钟就能到达.但是由于车多,人多,道路拥挤,致使我们要花费更多地时间 ...
- weex APIs
1.通过这个$vm()上下文访问这些api在脚本的方法 <script> module.exports = { methods: { somemethod: function() { th ...
- sql根据'/'截取最后的字符串
filpath字段值:/DataFile/UpLoad/Logo/NoPhoto.jpg select filpath,REVERSE((SUBSTRING(REVERSE(FilPath),0,CH ...
- JS打开窗口问题
语法 window.open(URL,name,features,replace) URL:一个可选的字符串,声明了要在新窗口中显示的文档的 URL.如果省略了这个参数,或者它的值是空字符串,那么新窗 ...
- listView中的button控件获取item的索引
在listview中的listitem设置事件响应,如果listitem中有button控件,这时候listitem就不会捕获到点击事件,而默认的是listitem中的button会捕获点击事件.那么 ...
- Echarts使用随笔(2)-Echarts中mapType and data
本文出处:http://blog.csdn.net/chenxiaodan_danny/article/details/39081071 series : [ { ...