0

this is my class name

public class Register extends TabGroupActivity

I am calling 2nd activity through

startChildActivity("Register", new Intent(Register.this,RegisterForm.class));

can any one help me how to transfer some data through this method

4

2 回答 2

2
Intent i = new Intent(Register.this,RegisterForm.class);
i.putExtra("name", yourdata);//i assume you are adding some string data
startChildActivity("Register", i);

//in RegisterForm.class

Intent i = RegisterForm.this.getIntent();
i.getStringExtra("name", "default Value you want");
于 2011-08-04T09:46:40.600 回答
0

您必须实现一个名为的接口Parecelable并将您的对象写入 aParcel中,以便您可以通过Intent

本教程将教你如何做到这一点

http://www.codexperience.co.za/post/passing-an-object-between-activities-using-an-intent

于 2013-08-02T13:06:53.047 回答