// 实际开发中常用的方法
         Intent intent = new Intent();
intent.setClass(MainActivity.this, LoginActivity.class);
startActivity(intent);
               //<疯狂Android>中介绍的方法 
         ComponentName comp = new ComponentName(MainActivity.this, FullscreenActivity02.class);
Intent intent = new Intent();
intent.setComponent(comp);
startActivity(intent);

界面间传值:

        // 数据打包
Bundle bdl = new Bundle();
bdl.putString("name", "A");
bdl.putInt("years", 17);
// 跳界传参
Intent itt_1 = new Intent(this, A01_Activity.class);
itt_1.putExtras(bdl); // 起跳
startActivity(itt_1);
//-----------------------------------------------------------------
// Intent->Bundle->取值
Intent itt_2 = getIntent();
Bundle dbl = itt_2.getExtras();
String str = dbl.getString("name");
int n = dbl.getInt("years"); System.out.println(str + "●<--------------------->●" + n);

或者不直接使用Bundle传参

        // 跳界传参
Intent itt_1 = new Intent(this, A01_Activity.class);
itt_1.putExtra("name", "A");
itt_1.putExtra("years", 18); // 起跳
startActivity(itt_1);
//-------取值的地方是一样的-------------------------------------------------------------------
// Intent->Bundle->取值
Intent itt_2 = getIntent();
Bundle dbl = itt_2.getExtras();
String str = dbl.getString("name");
int n = dbl.getInt("years");

Android:Activity的跳转的更多相关文章

  1. Android activity界面跳转动画

    实现activity界面跳转动画 1.在startActivity方法之后加入: overridePendingTransition(R.anim.pull_in_right, R.anim.pull ...

  2. Android Activity间跳转与传递数据

    1 概述 Activity之间的跳转主要使用 startActivity(Intent intent); startActivityForResult(Intent intent,int reques ...

  3. Android Activity切换(跳转)时出现黑屏的解决方法

    在两个Activity跳转时,由于第二个Activity在启动时加载了较多数据,就会在启动之前出现一个短暂的黑屏时间,解决这个问题比较简单的处理方法是将第二个Activity的主题设置成透明的,这样在 ...

  4. xamarin.android Activity之间跳转与传值

    前言 由于需要,所以接触到这个新的安卓开发模式,我会把我的学习经历全都记录下来,希望对大家有用. 导读 关于Activity,学习过安卓的人也应该明白什么是Activity,推荐新手去看YZF的这篇文 ...

  5. Android课程---Activity的跳转与传值(转自网上)

    Activity跳转与传值,主要是通过Intent类来连接多个Activity,以及传递数据.   Intent是Android一个很重要的类.Intent直译是“意图”,什么是意图呢?比如你想从这个 ...

  6. 实现android activity之间的跳转

    android程序一般不会只有一个activity,会碰到activity之间的跳转.以下是使用Intent做应用程序内部的activity做跳转.比如,应用程序第一个activity是: 点击“下一 ...

  7. android入门:activity之间跳转,并且回传参数

    介绍:         两个activity进行跳转,在跳转过程中,将message由MainActivity传递到secondActivity,并且当secondActivity退回至MainAct ...

  8. android使用ARouter跳转activity(阿里巴巴开源的)

    android使用ARouter跳转activity(阿里巴巴开源的) 使用ARouter方式,点击按钮跳转到其他activitypublic void buyOrSell(String str){ ...

  9. Android activity之间的跳转和数据传递

    1.Activity之间的跳转 并且 传递数据 A Activity进行的操作 Intent intent = new Intent(context, B.class); intent.putExtr ...

随机推荐

  1. 在Ext JS 5应用程序中如何使用路由

    简介 Ext JS 5是一个重要的发布版本,它提供了许多新特性来创建丰富的.企业级的Web应用程序.MVVM和双向数据绑定为开发人员承担了大量的繁重工作.在Ext JS 5种,另一个新特性就是路由,它 ...

  2. [shiro] Wildcard string cannot be null or empty. Make sure permission strings are properly formatted.

    访问某页面时,出现了这个异常: java.lang.IllegalArgumentException: Wildcard string cannot be null or empty. Make su ...

  3. HackerRank "Favorite sequence"

    Typical topological sorting problem .. why is it 'difficult'? #include <iostream> #include < ...

  4. (转)如何在eclipse的配置文件里指定jdk路径

    本文转载自:http://songguoliang.iteye.com/blog/1752519 运行eclipse时报如下错误: 在eclipse的配置文件里指定jdk路径,只需在eclipse的配 ...

  5. Python的更多内容

    到目前为止,我们已经学习了绝大多数常用的Python知识.在这一章中,我们将要学习另外一些方面的Python知识,从而使我们对Python的了解更加 完整 . 1.特殊的方法 在类中有一些特殊的方法具 ...

  6. RPM Fusion on CentOS7

    RPM Fusion RPM Fusion provides software that the Fedora Project or Red Hat doesn't want to ship. Tha ...

  7. Softerra LDAP Browser 使用及配置 有图有真相

    Softerra LDAP Browser 4.5 我使用Softerra LDAP Browser的目的,是为了查找公司的人员信息.网上关于Softerra LDAP Browser配置太少了,所以 ...

  8. C#动态调用C++编写的DLL函数

    C#动态调用C++编写的DLL函数 动态加载DLL需要使用Windows API函数:LoadLibrary.GetProcAddress以及FreeLibrary.我们可以使用DllImport在C ...

  9. room_speed和image_speed

    room_speed是游戏步数,每秒多少步(步事件)image_speed是动画帧率room_speed变则整个游戏变慢image_speed变只是该object动画变慢 除了游戏全局加速减速,一般不 ...

  10. NeHe OpenGL教程 第六课:纹理映射

    转自[翻译]NeHe OpenGL 教程 前言 声明,此 NeHe OpenGL教程系列文章由51博客yarin翻译(2010-08-19),本博客为转载并稍加整理与修改.对NeHe的OpenGL管线 ...