ActivityMain.java
Intent intent = new Intent();//生成一个Intent对象 intent.setClass(ActivityMain.this, SecActivity.class);//从ActivityMain跳转至SecActivity
//传递一个键值对 Bundle bundle=new Bundle(); bundle.putString("userName", strUserName); intent.putExtras(bundle); startActivity(intent);//启动跳转
SecActivity.java
//获取传递的数据 Bundle bundle=this.getIntent().getExtras(); String userName=bundle.getString("userName");