Intent方法 介绍和构造
2015-05-17 00:05
99 查看
Intent 介绍和构造
作用:
1指明执行动作 2在不同组件之间传递数据
3启动活动 启动服务 发送广播
1显式intent
示例:Intent intent = new Intent (FirstActivity.this, SecondActivity.class)
startActivity(intent);
// .this为启动活动的标志(上下文).class指定想要启动的活动
//将构建好的intent 传入startActivity启动活动
//按back键回到上一活动
2 隐式intent
在声明中用<intent-filter>声明可以响应的action和category 只要<action><category>与intent中指定的相匹配 该活动可以响应intent
//android.intent.category.DEFAULT是一种默认的category 在调用startActivity()时会自动添加到intent中
//只能匹配在<intent-filter>中声明的action 和category
作用:
1指明执行动作 2在不同组件之间传递数据
3启动活动 启动服务 发送广播
1显式intent
示例:Intent intent = new Intent (FirstActivity.this, SecondActivity.class)
startActivity(intent);
// .this为启动活动的标志(上下文).class指定想要启动的活动
//将构建好的intent 传入startActivity启动活动
//按back键回到上一活动
2 隐式intent
在声明中用<intent-filter>声明可以响应的action和category 只要<action><category>与intent中指定的相匹配 该活动可以响应intent
//android.intent.category.DEFAULT是一种默认的category 在调用startActivity()时会自动添加到intent中
//只能匹配在<intent-filter>中声明的action 和category
相关文章推荐
- Android学习笔记33:Intent介绍及Intent在Activity中的使用方法
- Intent介绍及Intent在Activity中的使用方法
- 黑马程序员——枚举的原理及枚举构造方法调用,抽象方法实现等等介绍
- Java图形界面基础实战项目讲解以及构造方法的介绍
- 6.1面向对象(介绍,类与对象,封装,this关键字,构造方法,static关键字)
- 【Android】Intent介绍及Intent在Activity中的使用方法
- Android学习笔记33:Intent介绍及Intent在Activity中的使用方法
- Intent介绍及Intent在Activity中的使用方法
- Intent介绍及使用方法
- Intent介绍及Intent在Activity中的使用方法
- day12今日内容介绍 1、构造方法 2、this关键字 3、super关键字
- PHP的构造方法,析构方法和this关键字详细介绍
- 【C#基础】方法及其调用、构造方法、out与ref参数及其返回值、方法重载、静态方法等简单介绍
- 黑马程序员-15-java基础-面向对象(1)-概念介绍与类、对象、构造方法
- PHP的构造方法,析构方法和this关键字详细介绍
- (十六)Core Java 枚举的使用(基本介绍,构造方法枚举,抽象方法枚举) (113)
- Intent介绍及Intent在Activity中的使用方法
- PHP的构造方法,析构方法和this关键字详细介绍
- OutMan——Objective-C中成员变量的作用域、@property和@synthesize介绍和使用、构造方法和自定义构造方法
- Android学习笔记33-Intent介绍及Intent在Activity中的使用方法