Android跳转Activity
来源:互联网 发布:windows资源管理器占用 编辑:程序博客网 时间:2024/06/08 06:29
1.普通跳转
<pre name="code" class="java">Intent intent = new Intent();//初始化 intent.setClass(Post.this, Add.class); // 设置Intent的源地址和目标地址
</pre>startActivity(intent); //调用startActivity方法发送意图给系统2.带参数跳转
<pre name="code" class="java">Intent intent = new Intent();//初始化 intent.setClass(Post.this, Add.class); // 设置Intent的源地址和目标地址 intent.putExtra("userName", userName);//将用户名传递到Add Activity</span>startActivity(intent); //调用startActivity方法发送意图给系统
<pre name="code" class="java">Intent intent = new Intent();//初始化 intent.setClass(Post.this, Add.class); // 设置Intent的源地址和目标地址 Bundle ex = new Bundle();startActivity(intent); //调用startActivity方法发送意图给系统
4.接收方接收
<pre name="code" class="java">//接收传过来的字符串Bundle bundle = getIntent().getExtras();String userName = bundle.getString("userName");
//接收传过来的数组Bundle bundle = getIntent().getExtras();Bundle a=this.getIntent().getExtras(); name = a.getStringArray("name");//String型数组name记得初始化
Intent intent = new Intent();//初始化 intent.setClass(Post.this, Add.class); // 设置Intent的源地址和目标地址 intent.putExtra("userName", userName);//将用户名传递到Add Activity</span>startActivity(intent); //调用startActivity方法发送意图给系统
0 0
- android Activity之间跳转。
- android Activity跳转
- Android Activity界面跳转
- Android-Activity常用跳转
- Android Activity之间跳转
- Android activity数据跳转
- Android Activity跳转动画
- Android Activity延迟跳转
- Android Activity延迟跳转
- Android Activity跳转
- android自动跳转activity
- Android跳转Activity
- Android中Activity跳转
- Android之Activity跳转
- Android自动跳转activity
- android activity 跳转延时
- android,activity跳转Html
- android activity跳转
- Facebook Hacker Cup 2015 Round 1 --- Winning at Sports
- Scrum基础
- android Spinner的简单demo(用到BaseAdapter)
- 汇编指令
- Mono For Android 如何控制程序在自动旋转功能开启下不进行横竖屏切换
- Android跳转Activity
- 如何让type="checkbox"不选中啊
- 单点登录 Ucenter 分析
- 思科CCNA第二学期第一章答案
- 苏飞论坛
- 从域名获取IP地址
- uva 10100 Longest Match(最长公共子序列)
- 关于Vector作为函数的返回值
- 【编程拾遗】预编译头文件来自编译器的早期版本