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

Adam Wagner
  • 15,469
  • 7
  • 52
  • 66
user878275
  • 21
  • 2

2 Answers2

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");
ngesh
  • 13,398
  • 4
  • 44
  • 60
  • thank you so much wuold you do me one more favour. may you tell how to recive data in other activity(RegisterForm.class). – user878275 Aug 10 '11 at 02:04
0

You have to implement an interface called Parecelable and write your object inside a Parcel so that you can transport it through the Intent

This tutorial will teach you how to do that

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