- UID
- 47
- 性别
- 保密
- 注册时间
- 2013-8-27
- 威望
-
- 金币
-
- Z币
-
- 听众
|
4向下一个Activity传递数据(使用Bundle和Intent.putExtras) Intent it = new Intent(Activity.MAIn.this, Activity2.class);
Bundle bundle=new Bundle();
bundle.putString("name", "This is from MainActivity!");
it.putExtras(bundle); // it.putExtra(“test”, "shuju”);
startActivity(it); // startActivityForResult(it,REQUEST_CODE);
对于数据 的获取可以采用: Bundle bundle=getIntent().getExtras();
String name=bundle.getString("name");
|
|