In my recent Android project there was a requirement to pass data to other Activity.
You can start the activity using following code:
Intent i = new Intent(context, OtherActivity.class); context.startActivity(i);
To pass around the data to other activity we can use putExtra() method of Intent class:
Intent i = new Intent(context, OtherActivity.class);
i.putExtra("key1", "value1");
i.putExtra("key2", "value2");
context.startActivity(i);
In the OtherActivity.class get the data using getIntent() method:
String value1 = getIntent().getExtras().getString("key1");
String value2 = getIntent().getExtras().getString("key2");