Android Intent应用
1. 显示Intent
// 直接设置Content和到下一个的Actvity的名字
Intent i = new Intent(MainActivity.this, AnotherAty.class);
startActivity(i);
2. 隐式Intent
1>. 在AndroidManifest.xml 配置activity时,添加 action中的name属性
<activity android:name=".AnotherAty">
<intent-filter>
<!-- 这里的action name 可以写任意的字符串,为了方便使用 用包名加 initent.actioin.AnotherAty (activity名) 组合的形式 -->
<action android:name="com.aaa.chengzhier.intent.action.AnotherAty" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity> 2> 然后在Intent中使用
Intent i = new Intent("com.aaa.chengzhier.intent.action.AnotherAty");
startActivity(i);
配注,不过一般 2> 那样写不怎么方便,可以在第二个 AnotherAty Activity中定义一个静态变量为 com.aaa.chengzhier.intent.action.AnotherAty
public static final String ACTION = "com.aaa.chengzhier.intent.action.AnotherAty";
在第一Activity中调用 Intent i = new Intent(AnotherAty.ACTION); startActivity(i);
Android Intent应用的更多相关文章
- android Intent介绍
Android中提供了Intent机制来协助应用间的交互与通讯,Intent负责对应用中一次操作的动作.动作涉及数据.附加数据进行描述,Android则根据此Intent的描述,负责找到对应的组件,将 ...
- android:Intent匹配action,category和data原则
1.当你在androidmanifest里面定义了一个或多个action时 你使用隐式意图其他activity或者service时,规定你隐式里面的action必须匹配XML中定义的action,可以 ...
- Android Intent
Intent在Android中的重要性不言而喻.本文主要总结下Intent使用过程中需要注意的一些问题. 1.隐式Intent AndroidManifest.xml声明时<intent-fil ...
- android intent和intent action大全
1.Intent的用法:(1)用Action跳转1,使用Action跳转,如果有一个程序的AndroidManifest.xml中的某一个 Activity的IntentFilter段中 定义了包含了 ...
- Android总结篇系列:Android Intent
Intent在Android中的重要性不言而喻.本文主要总结下Intent使用过程中需要注意的一些问题. 1.隐式Intent AndroidManifest.xml声明时<intent-fil ...
- 什么时候加上android.intent.category.DEFAULT
什么时候加上android.intent.category.DEFAULT 1.要弄清楚这个问题,首先需要弄明白什么是implicit(隐藏) intent什么是explicit(明确) intent ...
- (转)android.intent.action.MAIN与android.intent.category.LAUNCHER
android.intent.action.MAIN决定应用程序最先启动的Activity android.intent.category.LAUNCHER决定应用程序是否显示在程序列表里 在网上看到 ...
- android之android.intent.category.DEFAULT的用途和使用
1.要弄清楚这个问题,首先需要弄明白什么是implicit(隐藏) intent什么是explicit(明确) intent. Explicit Intent明确的指定了要启动的Acitivity , ...
- 理解android.intent.action.MAIN 与 android.intent.category.LAUNCHER
刚才看了一下sundy的视频<LLY110426_Android应用程序启动>,里面讲到luncher这个activity通过获取应用程序信息来加载应用程序,显示给用户,其中就是通过一个应 ...
- Android Intent的几种用法全面总结
Android Intent的几种用法全面总结 Intent, 用法 Intent应该算是Android中特有的东西.你可以在Intent中指定程序要执行的动作(比如:view,edit,dial), ...
随机推荐
- OpenStack Austin 峰会观察:OpenStack as IaaS 已是过去,Solutions on OpenStack 才是未来
虽然搞 OpenStack 前后也有几年,但是今年在美国 Austin 举办的 OpenStack Summit 我还是第一次参加.回来之后,一直还在回味,觉得要写点东西,将我在这次峰会上的观察和思考 ...
- Eclipse里面代码上下文变量点击后不一起变色
使用eclipse的时候,点击变量发现该类里面的变量颜色不变,经百度得知这个功能没有打开,下面打开方法: 1.使用“Alt+Shift+O”对该提示功能的开/关切换2.可以在以下设置选中后的文本提示颜 ...
- 翻译《Writing Idiomatic Python》(三):变量、字符串、列表
原书参考:http://www.jeffknupp.com/blog/2012/10/04/writing-idiomatic-python/ 上一篇:翻译<Writing Idiomatic ...
- UIPanelResetHelper(UIScrollView滚动复位)
原理 如果我们的UI中有滑动列表,并且列表比较长,那么不知道你们是否有这样需求,每次页面打开时,列表的滑动状态都恢复到默认状态. 如果要复位,其实就是修改UIPanel 的属性到初始状态.此组件做的工 ...
- Flex布局教程及属性速查
一.Flex布局介绍 伸缩盒模型(flexbox)是一个新的盒子模型,意为"弹性布局",用来为盒状模型提供最大的灵活性,主要优化了UI布局.Flexbox的功能主要包手:简单使用一 ...
- XML操作类
using System; using System.Data; using System.IO; using System.Xml; namespace DotNet.Utilities { ...
- javascript中的链表结构—双向链表
1.概念 上一个文章里我们已经了解到链表结构,链表的特点是长度不固定,不用担心插入新元素的时候新增位置的问题.插入一个元素的时候,只要找到插入点就可以了,不需要整体移动整个结构. 这里我们了解一下双向 ...
- SQL探险
两张表,取相同字段比较 相同则显示true 否则FALSE.
- 【转】【MySql】mysql存储过程中的异常处理
定义异常捕获类型及处理方法: DECLARE handler_action HANDLER FOR condition_value [, condition_value] ... statement ...
- linux numfmt 命令--转换数字
numfmt SYNOPSIS numfmt [OPTION]... [NUMBER]... DESCRIPTION Reformat NUMBER(s), or the numbers from s ...