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应用的更多相关文章

  1. android Intent介绍

    Android中提供了Intent机制来协助应用间的交互与通讯,Intent负责对应用中一次操作的动作.动作涉及数据.附加数据进行描述,Android则根据此Intent的描述,负责找到对应的组件,将 ...

  2. android:Intent匹配action,category和data原则

    1.当你在androidmanifest里面定义了一个或多个action时 你使用隐式意图其他activity或者service时,规定你隐式里面的action必须匹配XML中定义的action,可以 ...

  3. Android Intent

    Intent在Android中的重要性不言而喻.本文主要总结下Intent使用过程中需要注意的一些问题. 1.隐式Intent AndroidManifest.xml声明时<intent-fil ...

  4. android intent和intent action大全

    1.Intent的用法:(1)用Action跳转1,使用Action跳转,如果有一个程序的AndroidManifest.xml中的某一个 Activity的IntentFilter段中 定义了包含了 ...

  5. Android总结篇系列:Android Intent

    Intent在Android中的重要性不言而喻.本文主要总结下Intent使用过程中需要注意的一些问题. 1.隐式Intent AndroidManifest.xml声明时<intent-fil ...

  6. 什么时候加上android.intent.category.DEFAULT

    什么时候加上android.intent.category.DEFAULT 1.要弄清楚这个问题,首先需要弄明白什么是implicit(隐藏) intent什么是explicit(明确) intent ...

  7. (转)android.intent.action.MAIN与android.intent.category.LAUNCHER

    android.intent.action.MAIN决定应用程序最先启动的Activity android.intent.category.LAUNCHER决定应用程序是否显示在程序列表里 在网上看到 ...

  8. android之android.intent.category.DEFAULT的用途和使用

    1.要弄清楚这个问题,首先需要弄明白什么是implicit(隐藏) intent什么是explicit(明确) intent. Explicit Intent明确的指定了要启动的Acitivity , ...

  9. 理解android.intent.action.MAIN 与 android.intent.category.LAUNCHER

    刚才看了一下sundy的视频<LLY110426_Android应用程序启动>,里面讲到luncher这个activity通过获取应用程序信息来加载应用程序,显示给用户,其中就是通过一个应 ...

  10. Android Intent的几种用法全面总结

    Android Intent的几种用法全面总结 Intent, 用法 Intent应该算是Android中特有的东西.你可以在Intent中指定程序要执行的动作(比如:view,edit,dial), ...

随机推荐

  1. AI(Adobe Illustrator)简单入门——米老鼠

    成果: 步骤如下: 一.新建文档 二.选椭圆工具,在画布中间点一下,画一个100px*100px的圆,如下 三.同上,再画两个50px*50px小圆.点左上角的选择工具,点小圆中心,放好位置. 四.全 ...

  2. 《2016ThoughtWorks技术雷达峰会----js爆炸下的技术选型》

    JS爆炸下的技术选型  刘尚奇    ThoughtWorks, 高级咨询师 JS每6个星期出现一个新框架,那么如何进行JS的选型.以下从四个方面来分析. 1.工具 NPM for all the t ...

  3. NOIP2003神经网络[BFS]

    题目背景 人工神经网络(Artificial Neural Network)是一种新兴的具有自我学习能力的计算系统,在模式识别.函数逼近及贷款风险评估等诸多领域有广泛的应用.对神经网络的研究一直是当今 ...

  4. java-vector hashtable过时?

    vector hashtable过时? 在用JAVA集合时,IDE提示 vector 以及hashtable被arraylist ,hashmap替代,而前者又是线程同步的,不知道为什么?是效率差了的 ...

  5. [No00000D]word如何批量删除超链接 怎么去掉网址保留文字

    1.删除超链接的文字及网址 这种情况是想把带有网址的文字统统删掉,文字和网址一概不留. 首先在word界面按下ALT+F9(在所有的域代码及其结果间进行切换.),超链接文本会被转换成代码的样式. 例如 ...

  6. Android资料之-EditText中的inputType

    在编写有EditText的自定义控件的时候可能会用到EditText的inputType属性,直接在xml里写这个属性的时候是用字符串型的,不过动态设置的时候就变成int型了,InputType里有定 ...

  7. 开源框架】Android之史上最全最简单最有用的第三方开源库收集整理,有助于快速开发

    [原][开源框架]Android之史上最全最简单最有用的第三方开源库收集整理,有助于快速开发,欢迎各位... 时间 2015-01-05 10:08:18 我是程序猿,我为自己代言 原文  http: ...

  8. git删除远程仓库的文件或目录

    git rm -r --cached a/2.txt //删除a目录下的2.txt文件   删除a目录git rm -r --cached a git commit -m "删除a目录下的2 ...

  9. bytes和bytearray

    bytes bytes是Python 3中特有的,Python 2 里不区分bytes和str. Python 2中 >>> type(b'xxxxx') <type 'str ...

  10. AFNetworking 与 UIKit+AFNetworking 详解

    资料来源 : http://github.ibireme.com/github/list/ios GitHub : 链接地址 简介 : A delightful iOS and OS X networ ...