硕士生
 
- 金币
- 6496
- 好评
- 1
- 信誉
- 193
|
发表于
2023-1-13 11:50:33
来自手机
|
显示全部楼层
来自 重庆
2421746310 发表于 2023-1-12 00:18
求大佬写个源码,我自己试了好长时间没成功
Intent it = new Intent(A.this, B.class);
it.putExtra("extra_data", 119);
startActivity(it);
Intent it = getIntent();
String data = it.getIntExtra("extra_data");
或者
Intent it = new Intent(A.this, B.class);
Bundle bd = new Bundle();
bd.putInt("number", 1);
bd.putString("detail", "Hello");
it.putExtras(bd);
startActivity(it); |
|