//传值
Intent _intent =
new Intent();
_intent.setClass(第一个Activity. this, 要跳转的Activity. class);
_intent.putExtra("参数", "参数值");
_intent.setClass(第一个Activity. this, 要跳转的Activity. class);
_intent.putExtra("参数", "参数值");
this.startActivity(_intent);
//第二个页面接收
Intent _intent = getIntent();
String _value = _intent.getStringExtra("参数");
String _value = _intent.getStringExtra("参数");
2、页面传值(带返回值)
//第一个页面传送
Intent _intent =
new Intent();
_intent.setClass(第一个Activity. this, 要跳转的Activity. class);
_intent.putExtra("参数", "参数值");//不传参数的话,可以不加此行代码
this.startActivityForResult(_intent, CONTEXT_RESTRICTED);//CONTEXT_RESTRICTED int型变量,可自定义
_intent.setClass(第一个Activity. this, 要跳转的Activity. class);
_intent.putExtra("参数", "参数值");//不传参数的话,可以不加此行代码
this.startActivityForResult(_intent, CONTEXT_RESTRICTED);//CONTEXT_RESTRICTED int型变量,可自定义
//第二个页面返回值
Intent _intent = new Intent();
_intent.putExtra("参数名", "参数值");
setResult(CONTEXT_RESTRICTED, _intent);//CONTEXT_RESTRICTED int型变量,可自定义
finish();
_intent.putExtra("参数名", "参数值");
setResult(CONTEXT_RESTRICTED, _intent);//CONTEXT_RESTRICTED int型变量,可自定义
finish();
//第一个页面接收返回值,下面方法直接在页面加上即可
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Bundle bundle = data.getExtras();
String str = bundle.getString("参数名");
}