// 实际开发中常用的方法
         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. smarty变量

    前台: 注释的两种方式:<{**}>和<!--注释html代码-->比如: <{* <div style="width:100px; height:100 ...

  2. c# 可以设置透明度的 Panel 组件

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; u ...

  3. 使用 OWIN 作为 ASP.NET Web API 的宿主

    使用 OWIN 作为 ASP.NET Web API 的宿主 ASP.NET Web API 是一种框架,用于轻松构建可以访问多种客户端(包括浏览器和移动 设备)的 HTTP 服务. ASP.NET ...

  4. PHP header函数大全

    PHP header函数大全 header('Content-Type: text/html; charset=utf-8'); header('Location: http://www.php-no ...

  5. KB975517 "The update does not apply to your system"

    https://www.manageengine.com/products//desktop-central/patch-management/Windows-Vista-Ultimate-Editi ...

  6. HDU2490 parade

    题目大意:一个n+1行m+1列的表格,每个格子两个数w和c,表示经过该格子的happy和体力消耗值tireness.现在从最下面任意处开始,可以向左向右向上走.但不能向下.每个格子不能经过两次.在每一 ...

  7. java.io.FileNotFoundException:SESSIONS.ser (系统找不到指定的路径。)

    问题如下: java.io.FileNotFoundException: E:\apache-tomcat-8.0.37\work\Catalina\localhost\20161013Shoppin ...

  8. SQLServer分页存储过程

    创建存贮过程: Create PROCEDURE [dbo].[UP_GetRecordByPage]@tblName   varchar(255),       -- 表名@fldName varc ...

  9. [转]将Word转(保存)为带书签的PDF

    提到的方法非常管用,感谢原作者的分享. 原文地址:http://blog.163.com/rongting_chen/blog/static/16490684420114266192887/ 将wor ...

  10. HDU 5428 The Factor

    话说这题意真的是好难懂啊,尽管搜到了中文题意,然而还是没懂,最后看到了一个题解才懂的.http://www.cnblogs.com/Apro/p/4784808.html#3470972 题意:给出n ...