Tuesday, 27 August 2013

Receive multiple intents on an activity

Receive multiple intents on an activity

I have to send data from two different activities via intents to the same
activity. From activity1, the intent is passing data to EnquireActivity,
and from activity2 also, the intent is being passed to EnquireActivity.
How to receive these intents in the EnquireActivity. Any help would be
appreciated.
Activity 1:
Intent i1 = new Intent(this, EnquireActivity.class);
i1.putExtra("name",et_name.getText().toString());
i1.putExtra("adults",et_adult.getText().toString());
i1.putExtra("child",et_child.getText().toString());
i1.putExtra("email",et_email.getText().toString());
i1.putExtra("phone",et_phone.getText().toString());
i1.putExtra("datedept",date1);
i1.putExtra("datearr",date2);
i1.putStringArrayListExtra("list1", getChecked);
startActivity(i1);
Activity 2:
Intent intent = new Intent(this, EnquireActivity.class);
intent.putExtra("name", name);
intent.putExtra("night", n);
intent.putExtra("day", d);
intent.putExtra("dest", dest);
startActivity(intent);

No comments:

Post a Comment