XurajB
XurajB

Reputation: 840

lost in activities

I have an Activity that has some form elements. This can be called from other activities.. When the form activity loads, how do I know which one called it?

Thanks in advance..

Upvotes: 0

Views: 37

Answers (1)

Cristian
Cristian

Reputation: 200130

The easier way is to explicitly indicate that in the intent:

Intent i = new Intent(blnah);
i.putExtra("who", "Activity1");
startActivity(intent);

Then, on the other activity:

// this is the activity with the form
String who = getIntent().getStringExtra("who");

Upvotes: 1

Related Questions