一,在被启动的Activity中新加一个静态方法
public static void actionStart(Context context, String data1, String data2) {
Intent intent = new Intent(context, SecondActivity.class);
intent.putExtra("param1", data1);
intent.putExtra("param2", data2);
context.startActivity(intent);
}
二,在启动的Activity中
SecondActivity.actionStart(FirstActivity.this, "data1", "data2");
时间: 2024-10-21 16:07:03