1.不夹带数据直接启动
Intent it = new Intent(this,要启动的Activity.class);
startActicity(it);
2.夹带数据
a)启动并发送
Intent it = new Intent(this,要启动的Activity.class);
it.putExtra(“数据名1”,“数据值”);
it.putExtra(“数据名2”,100);
startActivity(it);
b)接受
Intent it = getIntent();
int bianhao = it.getInEXtra(“数据名2”,0);
String nerirong = it.getStringExtra(“数据名1”);
启动新的Activity
最新推荐文章于 2021-05-28 14:55:08 发布